Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Audit and CDC

Author  Topic 

gpascanu
Starting Member

2 Posts

Posted - 2009-07-08 : 02:31:32
Hi,

I am tiring to log the changes made to a table (insert, update, delete) and display them in a user friendly manner.

What I need is something like this:
username, database, table, column, old value, new value, date.

If I am using SQL server Audit and create a database audit I get the statement that was executed, but not the new and old values, and is not user friendly so I will have to parse this.
If I use the Change Data Capture I get the values that where changed and the column, but not who changed them.

Is there a way to link these two approaches?

Thanks

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-07-08 : 02:44:59
Introduce a new Column in your Master table as "Modified_by"

If A DML statement hits the table, update the value in that column. For your audit purpose u can make use of this..

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

gpascanu
Starting Member

2 Posts

Posted - 2009-07-08 : 04:09:59
I am not allowed to change the structure of that table, but I can add another table. Any other ideas?

Thanks
Go to Top of Page
   

- Advertisement -