How to read transaction log of SQL Server database?

Poster
Posted by Poster under Sql Server category on | Views : 4751
To read the transaction log of SQL Server database use DBCC Log command and passed desired parameter.

DBCC log (MY_DB, 4)


DBCC LOG(<database name>[,{0|1|2|3|4}])

0 ? Basic Log Information (default)
1 ? Lengthy Info
2 ? Very Length Info
3 ? Detailed
4 ? Full Example

Thanks

Comments or Responses

Posted by: Pandians on: 8/28/2009 Level:Silver | Status: [Member] [MVP]
Hi,

Nice Information.

Pl note we have one more Un-Documended function :

Fn_DBLog

SELECT * FROM Fn_DBLog(StartLSN, EndLSN)

The two parameters are optional, So that we can give as NULL. It will read the all log info of the current Database.

We can use the range StartLSN, EndLSN. But the LSN will be in Hexadecimal format of data. We have to concert it into Integer and then we can use.

Cheers

Login to post response