Adsense

Thursday, January 3, 2013

Monitoring Deadlock in SQL Server


 SQL Server can passively write deadlocks to the log.  To do this you can turn on two traces:
                DBCC TRACEON(1222,-1)
DBCC TRACEON(1204,-1)

Trace 1204 Returns the resources and types of locks participating in a deadlock and also the current command affected
Trace 1222 Returns the resources and types of locks that are participating in a deadlock and also the current command affected, in an XML format that does not comply with any XSD schema.

For more information on trace flags refer to http://msdn.microsoft.com/en-us/library/ms188396.aspx

No comments:

Post a Comment