I need to audit all accesses, updates, inserts, deletes, executes, etc. done to specific tables in our database. I upgraded my SQL Server to 2008 so I could use the new Audit functionality. This works great and shows me everything I need and who accessed it. The problem is I don't know what the query contained. Let me give some examples:
If I run a query from the Management studio it gives me the following:
Query that was run: Select * From Customer Where ID = '123'
Audit shows this: Select * From Customer Where ID = '123'
This is what I would expect all the time. But if I add in a parameter it gives the following:
Query that was run: Declare @id varchar(255)
Set @id = '123'
Select * From Customer Where ID = @id
Audit show this: Select * From Customer Where ID = @id
I would like to be able to see what the parameter was in case I need to investigate something.
Does anyone have any suggestions? Our application sends in thousands of stored procedures with parameters and how it currently works won't help.
Thanks in advance!