문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top