Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Column level audit ... Expand / Collapse
Posted Thursday, August 30, 2012 5:53 AM

SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 27, 2015 2:47 AM
Points: 47, Visits: 292
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,

Post #1352126
Posted Thursday, August 30, 2012 8:23 AM



Group: General Forum Members
Last Login: Friday, December 2, 2016 3:25 AM
Points: 7,933, Visits: 14,355
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
Post #1352261
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse