4

I have a question about SQL SERVER ?

Change Data Capture (CDC)

I apply the CDC process in which the user DELETE, UPDATE, INSERT operations do not have that. So, how can I get the information of the user name?

2 Answers2

1

You can use a trigger to log the operation and the user name. Try the function SUSER_NAME() or SUSER_ID().

Mithrandir
  • 24,869
  • 6
  • 50
  • 66
0

Another way is to have an extra column in your tracked tables, that store a user ID that commited the current change.
When you look at the history of the table it will store each row with the appropriate user ID.

Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632