Ancient Ancient -3 years ago 89
SQL Question

How to know which column's value is changed in CDC

I am using CDC feature in sql 2012 and lets suppose i have a table name as

Employee
and also have some records in it . Suppose someone changed
Last Name
in employee's table . Then there goes 2 entries in
CDC
table , have both records before change and after change . I want to know that which column is changed .

I am following this tutorial

Answer Source

I think what you're looking for is column tracking. You'll need to utilize the CHANGETABLE function to get what you want.

Column tracking information appears in the SYS_CHANGE_COLUMNS column that is returned by the CHANGETABLE(CHANGES …) function.

Check out this MSDN article for more information.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download