FreeNo sign-up.

SQL Server Deadlock Graph Analyzer

Paste a SQL Server deadlock graph. dbCove AI shows who blocked whom, why the cycle formed and the change that stops error 1205.

How to get the deadlock graph

From system_health

Every instance keeps its recent deadlocks in the system_health session:

SELECT CAST(event_data AS xml) FROM sys.fn_xe_file_target_read_file('system_health*.xel', NULL, NULL, NULL) WHERE object_name = 'xml_deadlock_report';
An .xdl file

A deadlock saved from SSMS or Profiler is the same XML: open it in a text editor and paste it.

From the error log

With trace flag 1222 on, every deadlock is written to the error log as text, which works too:

DBCC TRACEON (1222, -1);

What it looks for in a deadlock graph

Who held and who waited

The owner-list and waiter-list of each resource, with the lock modes on both sides.

Key lookup deadlocks

A SELECT on a nonclustered index meeting an UPDATE on the clustered index: the most common pattern.

Lock order

Two procedures that touch the same tables or keys in opposite order.

Isolation level

Range locks under SERIALIZABLE, and the isolation level of each process.

The victim

Which statement got error 1205, and from which program and host.

Read nextError 1205 in SQL Server: read the deadlock graph and fix the cause

This was one deadlock. dbCove catches every one.

On your own databases dbCove records every deadlock with the statements on both sides, groups them by pattern, and its AI explains them as they happen. Free for 2 databases of each engine.

Questions

Is what I paste kept?

It is sent to our AI provider to be explained and kept by us for up to 12 months to improve the tools; the AI provider does not keep it or train on it. Remove passwords and personal data before you paste.

Where do I find the deadlock graph?

In the system_health Extended Events session, which every instance runs. The query above returns each xml_deadlock_report it kept. No trace flag is needed.

Is retrying error 1205 enough?

A retry hides a deadlock, it does not remove it: the same transactions meet again under load. The answer gives the change that breaks the cycle, and a retry only as a safety net.

Which versions does it read?

SQL Server 2012 to 2022, Azure SQL Database and Azure SQL Managed Instance.