SQL Server Admin
T-SQL Articles

April 27, 2009

How to View Transaction Log in SQL Server




As a DBA, you may need to view the Transaction Log in SQL Server. This information is not typically available to common db users but can be obtained using a simple undocumented command

DBCC log ( dbname, 0|1|2|3|4 )

where

0: minimum information (Default)
1: Returns info available using 0 + flags, tags and the log record length.
2: Returns info available using 1 + object, index, page ID and slot ID.
3: Maximum information about each operation.
4: Maximum information about each operation + hexadecimal dump of the current transaction log row

In order to run this command against a database called 'PictureAlbum' :-


DBCC LOG(PictureAlbum, 3)





OUTPUT:


Did you like this post?
kick it on DotNetKicks.com
subscribe via rss subscribe via e-mail
print this post follow me on twitter



 
  Feedback:

comments

0 Responses to "How to View Transaction Log in SQL Server"
 

Copyright © 2009-2011 All Rights Reserved for SQLServerCurry.com by Suprotim Agarwal | Terms and Conditions