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?
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?
You can use a trigger to log the operation and the user name. Try the function SUSER_NAME()
or SUSER_ID()
.
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.