Reputation: 259
I have been using SQL Server 2008 for about a year now and my knowledge is steadily progressing.
The nature of the data I work with is fairly sensitive and as a result I wanted to ensure the integrity of it by implementing an audit table. I successfully followed http://msdn.microsoft.com/en-us/library/cc627397.aspx to guide me through the process and create my audit table.
So my question is in my log file there is a column called Statement
which describes the action carried out i.e. Select/Update/Delete followed by the query ran. If I run a query with a where condition I don't get the value I inputted, i.e. Where [Year] = 2010
, instead in my log file it is displayed as Where [Year] = @Param1
How can I get my file to display the value ran in the query?
Upvotes: 2
Views: 969
Reputation: 50825
You're going to need to use triggers to do that so you have access to the INSERTED
and DELETED
tables. I use a modified version of this article in my own projects:
Adding simple trigger-based auditing to your SQL Server database
Upvotes: 1