I need to know if there is any way to know every sentence executed in a SQL Server 2005 database. That is because I have a registry modified in a concrete date, and I would like to know the sentence executed to update the registry. Of course, if I could have more information besides the sentence, it would be great!
Thank you very much!
If your statement has been executed in the very recent past, this query will get you the last few executed statements and may be of use.
If you know when the statement gets executed, and want to capture all SQL statements at the time, then you can use the Profiler to Trace all activity.
http://msdn.microsoft.com/en-us/library/ms187929%28v=SQL.90%29.aspx