|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, April 01, 2013 8:45 AM
Points: 47,
Visits: 253
|
|
I need to trace the user log against my database tables. Most of the tables have the customer’s sensitive data. I need save every action (select , insert, update and delete) against those tables information with user log to AuditLog table.
For example, If a user viewed or insert or update or delete the SocialSecurityNumber from customer table, I need to enter the above actions with user information to AuditLog table.
Can anyone help me on this... Thanks in advance,
Nithi
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 1:24 PM
Points: 6,826,
Visits: 11,950
|
|
You can capture DML operations (i.e. INSERT, UPDATE and DELETE) using TRIGGER. SELECT operations are a bit trickier. Are you using stored procedures for all data access? If so you can add rows to your AuditLog table whenever a proc that selects data is called. If you are not using stored procedures then you will need to use a Server-side Trace or Log Reader to capture SELECT operations since there is no trigger mechanism available from T-SQL that you can code against to respond to those.
__________________________________________________________________________________________________ There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|