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
 General SQL Server Forums
 New to SQL Server Programming
 SSRS Audit table

Author  Topic 

antopic
Starting Member

2 Posts

Posted - 2014-04-09 : 11:58:29
Hi All,

I'm trying to create and Audit report for different tables.
I'd like to use an generic table structure for the report which will be temp.

I was thinking something like this:
AuditID
,TableName
,FieldName
,OldValue
,NewValue
,DateAction
,UserName
,ActionType (update, insert, delete)

I've already created the audit table with same structure plus all field duplicated and action type. (this was a request)

Now I need to group it for the report.
following an example of audit table I've created

tblTest_audit
(
ID
ID_new
Name
Name_new
Address
Address_new
)

How can I fill my temp table? Any suggestions are really appreciated.

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-04-13 : 14:42:30
you need to create a INSERT/UPDATE/DELETE trigger on the relevant tables for that

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -