- Copy the XML file to the server where SQL instance is installed.
- Open SQL server profiler > click on file > Open trace file > change the file type to XML > Select the XML trace file.
- Click on the deadlock graph event in the profiler displayed traces.
How to generate deadlock graph using XML trace file sql server
How to generate SQL server deadlock graphs from the capture XML deadlocks trace file
4 answers
Sort by: Most helpful
-
siddhardha vadella 0 Reputation points
2023-01-16T17:38:05.6333333+00:00 -
Erland Sommarskog 115.4K Reputation points MVP
2023-01-16T22:40:02.23+00:00 You should not look at the deadlock graph, but I have never been able to understand it. Also, the graph hides a lot of information about the deadlock, for instance if any process in an active transaction. Look at the raw XML instead.
-
LiHongMSFT-4306 29,826 Reputation points
2023-01-17T03:14:10.86+00:00 How to generate SQL server deadlock graphs from the capture XML deadlocks trace file
Please refer to this article: Understanding the graphical representation of the SQL Server Deadlock Graph.
As Erland answered, the deadlock graphical representation on its own is not always enough. There is some information which is not available just by looking at the graph, which is available in the XML description.
So please refer to this article: Understanding the XML description of the Deadlock Graph.
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
Olaf Helper 45,616 Reputation points
2023-01-17T07:01:32.59+00:00 Or use SSMS to have a look at the deadlock graph:
[https://learn.microsoft.com/en-us/sql/relational-databases/performance/open-view-and-print-a-deadlock-file-sql-server-management-studio?view=sql-server-ver16