How It Works: SQL Server Deadlock Trace Flag 1222 Output


Moved from: bobsql.com

The trace flag 1222 can be very powerful and helpful in tracking down the cause of a deadlock when used correctly.

 

This week I was tracking down a blocking situation, which I expected the lock monitor to resolve as a deadlock.   The test in question is designed to cause large amounts of deadlocks in order to stress the deadlock detection and resolution code paths.  I was looking to see if the problem was an undetected deadlock that lock monitor was struggling with or something else, and to my surprise I found it was the trace flag –T1222.