Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top