How can I find information about updating or inserting a sql table row in sql server 2008?

543 views Asked by At

I am looking for information about my table history, I have to know the time that specific row was inserted is there someway to know it? thanks.

1

There are 1 answers

0
M.Ali On BEST ANSWER

Using Triggers

A Datetime column in that table and an After Insert,Update Trigger which updates that column to GETDATE().

This will only give you the details about the very last change(update/Insert).

CDC

Change Data Capture (CDC) was introduced in SQL Server 2008. Change Data Capture records INSERTs, UPDATEs, and DELETEs applied to SQL Server tables, and makes a record available of what changed, where, and when, in simple relational ‘change tables’.

These "Change Tables" contain columns that reflect the column structure of the source table you have chosen to track, along with the metadata needed to understand the changes that have been made.

Read here more about CDC

Also it is only supported in Datacenter & Enterprise edition.