views:

23

answers:

2

Trying to track down a bug in an application, but need to confirm whether a column value was changed on a particular record in SQL 2005.

How can I query the transaction logs for the record's previous column values?

A: 

Transaction logs aren't typically supposed to be directly queryable, but for exceptional circumstances, you can use the DBCC LOG command to get information from the transaction log. The output isn't exactly straightforward, and it would be a difficult task to determine whether a given column value was changed.

If you know the date of the change, it would probably be simpler to restore a copy of the database before and after the change to verify that the change was made.

Ryan Brunner
+2  A: 

Agreed it won't be easy. You can also investigate fn_dblogas in this post Decoding a Simple Update Statement Within the Transaction Log

Martin Smith