Investigate deadlocks
Use the Deadlocks view to investigate deadlock events captured for monitored SQL Server database instances. The view provides visibility into blocked workloads, impacted sessions, and recurring concurrency patterns — helping database administrators identify victim queries, contested resources, and the application context behind each event.
By default, the Deadlocks view displays all captured deadlock events for the selected time range in the Deadlock Victims grid.
What is a deadlock?
A deadlock occurs when two or more SQL Server sessions are waiting on resources held by each other, creating a circular dependency that cannot resolve on its own. SQL Server detects the cycle and selects one session as the deadlock victim, terminating that session's transaction so the others can proceed.
Use the Deadlocks view to:
-
Identify which queries and sessions are repeatedly selected as victims
-
Determine which database objects and indexes are most frequently contested
-
Correlate deadlock events with specific applications, hosts, or workload windows
-
Analyze lock ownership and wait relationships within individual events
-
Build evidence for concurrency fixes such as index changes, transaction reordering, or batch size reductions
Access the Deadlocks view
-
Click Databases and select the SQL Server instance to investigate.
-
Click Locking.
-
Click Deadlocks.
The Deadlock Victims grid loads with captured events for the selected time range.
If no events appear, verify the selected time range and confirm that deadlock collection is enabled for the instance.
Review the Deadlock Victims grid
The grid displays one row per captured deadlock event. Use the grid to scan recent activity, spot recurring patterns, and compare victim sessions across events.
| Column | Description |
|---|---|
| Time | Timestamp of the deadlock event. |
| SPID | SQL Server session ID selected as the deadlock victim. |
| Database Instance | Monitored database instance associated with the event. |
| Victim Host | Host name of the victim session. |
| Victim Application | Client application associated with the victim session. |
| Victim Database | Database involved in the deadlock event. |
| User | Login or user associated with the victim session. |
| Query Text | Captured victim query text. |
Filter and sort deadlock events
Use the filter toolbar to narrow results. Available filters:
-
SPID: Isolate events for a specific session ID.
-
Application: Focus on a specific client application.
-
Victim Database: Scope to a single database.
-
User: Narrow to a specific login or user.
-
Query Text: Search for specific query patterns.
Apply sorting to group events by recency, recurring SPID, application, or database. This helps distinguish isolated contention from recurring concurrency problems.
View deadlock event details
Click any row in the grid to open the Event Information side sheet. The side sheet provides four views:
| View | Description |
|---|---|
| Diagram | Visual deadlock graph showing participating processes and contested resources. |
| XML | Raw deadlock XML payload with syntax highlighting and copy support. |
| Metadata | Attributes for the selected process, victim, or resource. This information updates dynamically based on the current selection. |
| Victim Query | Captured query text for the deadlock victim. |
If View Details is available, use it to open query-level context for deeper investigation.
Analyze the deadlock diagram
The Diagram tab renders the deadlock cycle as a graph. Processes appear as nodes, and contested resources appear as edges or resource nodes between them. The victim process is identified within the graph.
Select any node or link to populate the metadata panel with attributes for that element, including:
- Lock mode
- Wait duration
- Login
- Application
- Object name
- Index name
- Wait resource
Use the diagram to:
-
Identify the victim and surviving processes
-
Trace the circular wait dependency
-
Determine which objects and indexes are contested
-
Compare lock modes across participating sessions
Use the XML tab alongside the diagram to validate rendered information or copy the full payload for escalation or support workflows.
Review metadata and victim query
The Metadata panel updates based on the element selected in the diagram. Depending on the selection, the panel can include:
| Field | Description |
|---|---|
| Deadlock priority | Priority value SQL Server used to select the victim. |
| Host | Host name of the selected process or session. |
| Application | Client application of the selected process or session. |
| Login | Login or user name of the selected process or session. |
| Wait duration | Time the selected process was waiting. |
| Lock mode | Lock mode held or requested by the selected process or resource. |
| Isolation level | Transaction isolation level of the selected process. |
| Transaction name | Transaction name associated with the selected process. |
| Object name | Database object involved in the event. |
| Index name | Index involved in the event. |
| Wait resource | Resource the selected process was waiting on. |
Use the Victim Query section to review the query text associated with the deadlock victim. This can help identify:
-
Long-running transactions holding locks for extended periods
-
Large update or delete operations that escalate locks
-
Missing query filters that cause broad lock acquisition
-
Inconsistent object access order across code paths
If View Details is available, use it to continue the investigation in the query analysis workflow.
Investigate recurring deadlocks
Use this workflow when deadlocks recur across multiple events:
-
Expand the time range to confirm how frequently events occur.
-
Sort or filter by SPID, application, database, object, or query text to identify repeating patterns.
-
Open individual events to analyze victim query text and metadata.
-
Correlate deadlock timing with blocking activity and peak workload periods.
-
Apply a remediation and monitor whether deadlock frequency decreases.
Repeated deadlocks involving the same queries, databases, applications, or resources typically indicate a concurrency design problem rather than isolated contention.
Common remediation strategies
-
Keep transactions short and commit changes promptly to reduce lock hold time.
-
Access shared resources in a consistent order across all application code paths.
-
Improve indexing to reduce the number of rows locked and limit lock escalation.
-
Reduce batch sizes for large update or delete operations.
-
Implement retry logic for deadlock victim errors where application tolerance allows.
Notes
-
Deadlock event visibility depends on collection configuration, data retention policy, and the selected time range.
-
The Deadlocks view supports SQL Server instances only. Deadlock collection must be enabled for the monitored instance.
-
For related context, use the Blocking view and query investigation workflows within Database Observability.