Detecting deadlocks with Trace Flag 1204

In the previous recipe, Detecting deadlocks with SQL Server Profiler, we learned to detect deadlocks using SQL Server Profiler. This can be useful when deadlocks occur regularly in a specific pattern and you are able to reproduce them by executing certain part of application code that you know produces the deadlock. For this type of investigation, you simply start an SQL Trace session, reproduce the deadlock condition, and analyze the queries.

However, when deadlocks occur irregularly, without any specific pattern, it becomes hard for you to investigate them because you do not know in which case they occur. Thus, it also becomes difficult for you to reproduce them. To troubleshoot such irregular deadlocks, ...

Get Microsoft SQL Server 2012 Performance Tuning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.