SQL Profiler Trace to Capture Deadlock Information

Issue:

Customer is receiving Deadlock errors in their SedonaOffice company. Is there a way to get mor information on why the lock is occurring? 

Resolution:

SQL server Profiler can be used to identify the cause of a deadlock. A deadlock occurs when there is a cyclic dependency between two or more threads, or processes, for some set of resources within SQL Server. Using SQL Server Profiler, you can create a trace that records, replays, and displays deadlock events for analysis.

Select the Template TSQL_Locks

A screenshot of a computer programDescription automatically generated

In the Events Selection Tab, you’ll see the events it will monitor.

Be sure the only options selected are for the Locks section shown below.

A screenshot of a computer programDescription automatically generated 

Remove any other options that might be checked on.

A screenshot of a computer programDescription automatically generated

You can configure SQL Server Profiler to extract Deadlock graph events to a single file that contains all Deadlock graph events, or to separate files. This extraction can be done in any of the following ways:

When starting and configuring the trace, Use the Events Extraction Settings tab to set the file name and location. 

Note: that this tab does not appear until you select the Deadlock graph event on the Events Selection tab.

A screenshot of a computerDescription automatically generated

For more information see Microsoft’s Deadlocks guide at the link below.

https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-deadlocks-guide?view=sql-server-ver16&source=recommendations

 

 

 

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted for approval.