{"id":942,"date":"2025-01-03T10:43:00","date_gmt":"2025-01-03T15:43:00","guid":{"rendered":"https:\/\/www.sqltabletalk.com\/?p=942"},"modified":"2025-01-03T10:43:08","modified_gmt":"2025-01-03T15:43:08","slug":"reading-sql-server-xml-deadlock-report-system-health","status":"publish","type":"post","link":"https:\/\/www.sqltabletalk.com\/?p=942","title":{"rendered":"Reading SQL Server&#8217;s XML Deadlock Report Captured by the system_health Event"},"content":{"rendered":"<h1>Introduction<\/h1>\n<p>SQL Server includes an Extended Events session called <strong>system_health<\/strong>, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the <strong>system_health<\/strong> session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.<\/p>\n<p>Below is a walkthrough of how to interpret a sample XML deadlock report, followed by a brief note on how to access this output.<\/p>\n<h2>1. The &lt;deadlock&gt; Root Element<\/h2>\n<pre><code>&lt;deadlock&gt;\n   ...\n&lt;\/deadlock&gt;<\/code><\/pre>\n<p>Every deadlock report is wrapped in a <code>&lt;deadlock&gt;<\/code> element. Inside, you\u2019ll see:<\/p>\n<ul>\n<li><strong>victim-list<\/strong><\/li>\n<li><strong>process-list<\/strong><\/li>\n<li><strong>resource-list<\/strong><\/li>\n<\/ul>\n<p>These sections collectively describe the details of the deadlock and help you identify the root cause.<\/p>\n<h2>2. The &lt;victim-list&gt; Section<\/h2>\n<pre><code>&lt;victim-list&gt;\n  &lt;victimProcess id=\"process292009b2ca8\"\/&gt;\n&lt;\/victim-list&gt;<\/code><\/pre>\n<ul>\n<li><strong>victimProcess<\/strong>: Shows the process ID (<code>id<\/code>) of the session chosen as the deadlock victim. SQL Server terminates this session\u2019s transaction to resolve the deadlock. Here, <code>process292009b2ca8<\/code> is the victim.<\/li>\n<\/ul>\n<p><strong>Key takeaway<\/strong>: If this is your session or query, it means SQL Server chose it to be rolled back. Often, short-running or lower-priority transactions become victims.<\/p>\n<h2>3. The &lt;process-list&gt; Section<\/h2>\n<pre><code>&lt;process-list&gt;\n  &lt;process id=\"process292009b2ca8\" ... spid=\"87\" ... &gt;\n    ...\n  &lt;\/process&gt;\n  &lt;process id=\"process292009bb088\" ... spid=\"61\" ... &gt;\n    ...\n  &lt;\/process&gt;\n&lt;\/process-list&gt;<\/code><\/pre>\n<p>In a deadlock, at least two processes are involved. Each <code>&lt;process&gt;<\/code> element provides information such as:<\/p>\n<ul>\n<li><strong>id<\/strong>: Matches the process in the victim-list or resource-list.<\/li>\n<li><strong>spid<\/strong>: The SQL Server session ID.<\/li>\n<li><strong>status<\/strong>: Could be \u201csuspended,\u201d indicating it\u2019s waiting on a lock.<\/li>\n<li><strong>waittime<\/strong>: How long (in milliseconds) this session has been waiting.<\/li>\n<li><strong>waitresource<\/strong>: Which resource this session is trying to acquire (e.g., a key lock on a specific table).<\/li>\n<li><strong>lasttranstarted<\/strong>: When the current transaction started.<\/li>\n<li><strong>isolationlevel<\/strong>: Transaction isolation level (here, <code>read committed<\/code>).<\/li>\n<li><strong>loginname<\/strong> &amp; <strong>hostname<\/strong>: Which user and machine initiated the transaction.<\/li>\n<li><strong>executionStack<\/strong>: Provides the T-SQL call stack and stored procedure calls.<\/li>\n<li><strong>inputbuf<\/strong>: Shows the query (or stored procedure call) that was executed.<\/li>\n<\/ul>\n<h3>Example Interpretation<\/h3>\n<pre><code>&lt;process id=\"process292009b2ca8\" ... spid=\"87\" ... &gt;\n  &lt;executionStack&gt;\n    &lt;frame procname=\"testdb.dbo.sp_UpdateTableB\" line=\"33\" ...&gt;\n      UPDATE dbo.TableA\n      SET Column1 = CONCAT('UpdatedA_by_Session_', @@SPID)\n      WHERE ID = @I\n    &lt;\/frame&gt;\n    &lt;frame procname=\"adhoc\" line=\"2\" ...&gt;\n      EXEC dbo.sp_UpdateTableB @ID = 1, @DelaySeconds = 1\n    &lt;\/frame&gt;\n  &lt;\/executionStack&gt;\n  &lt;inputbuf&gt;\n    EXEC dbo.sp_UpdateTableB @ID = 1, @DelaySeconds = 12;\n  &lt;\/inputbuf&gt;\n&lt;\/process&gt;<\/code><\/pre>\n<ul>\n<li>The session with <code>spid=\"87\"<\/code> is running a stored procedure named <strong>sp_UpdateTableB<\/strong>, which in turn updates <strong>TableA<\/strong>.<\/li>\n<li>The <code>inputbuf<\/code> tells us the exact command that was sent: <code>EXEC dbo.sp_UpdateTableB @ID = 1, @DelaySeconds = 12;<\/code><\/li>\n<\/ul>\n<p>Similarly, another <code>&lt;process&gt;<\/code> element (<code>spid=\"61\"<\/code>) is calling <strong>sp_UpdateTableA<\/strong>, which updates <strong>TableB<\/strong>.<\/p>\n<p>When these two sessions simultaneously attempt to update each other\u2019s tables (A and B), a cyclical locking scenario is created, leading to a deadlock.<\/p>\n<h2>4. The &lt;resource-list&gt; Section<\/h2>\n<pre><code>&lt;resource-list&gt;\n  &lt;keylock hobtid=\"72057594046382080\" dbid=\"20\" objectname=\"testdb.dbo.TableA\" ...&gt;\n    &lt;owner-list&gt;\n      &lt;owner id=\"process292009bb088\" mode=\"X\"\/&gt;\n    &lt;\/owner-list&gt;\n    &lt;waiter-list&gt;\n      &lt;waiter id=\"process292009b2ca8\" mode=\"X\" requestType=\"wait\"\/&gt;\n    &lt;\/waiter-list&gt;\n  &lt;\/keylock&gt;\n  &lt;keylock hobtid=\"72057594046447616\" dbid=\"20\" objectname=\"testdb.dbo.TableB\" ...&gt;\n    &lt;owner-list&gt;\n      &lt;owner id=\"process292009b2ca8\" mode=\"X\"\/&gt;\n    &lt;\/owner-list&gt;\n    &lt;waiter-list&gt;\n      &lt;waiter id=\"process292009bb088\" mode=\"X\" requestType=\"wait\"\/&gt;\n    &lt;\/waiter-list&gt;\n  &lt;\/keylock&gt;\n&lt;\/resource-list&gt;<\/code><\/pre>\n<p>Here you see two <strong>keylock<\/strong> elements, each representing a locked resource:<\/p>\n<ol>\n<li><strong>Keylock on TableA<\/strong>\n<ul>\n<li>Owned by <code>process292009bb088<\/code> (<code>spid=\"61\"<\/code>).<\/li>\n<li>Waited on by <code>process292009b2ca8<\/code> (<code>spid=\"87\"<\/code>).<\/li>\n<\/ul>\n<\/li>\n<li><strong>Keylock on TableB<\/strong>\n<ul>\n<li>Owned by <code>process292009b2ca8<\/code> (<code>spid=\"87\"<\/code>).<\/li>\n<li>Waited on by <code>process292009bb088<\/code> (<code>spid=\"61\"<\/code>).<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>This cyclical pattern of \u201cowner\u201d and \u201cwaiter\u201d is the hallmark of a deadlock: each process owns a lock the other needs, and neither can proceed until the other releases it. The <code>mode=\"X\"<\/code> attribute indicates both processes are waiting for an exclusive lock.<\/p>\n<h2>5. Putting It All Together<\/h2>\n<ol>\n<li><strong>Identify the Victim<\/strong>In the <code>&lt;victim-list&gt;<\/code> tag, look for which process was chosen to be rolled back.<\/li>\n<li><strong>Review Each Process<\/strong>The <code>&lt;process-list&gt;<\/code> shows what each session was doing, including stored procedures, line numbers, and queries.<\/li>\n<li><strong>Check Resources<\/strong>The <code>&lt;resource-list&gt;<\/code> clarifies which locks each process holds and which they are requesting. Notice the cyclical dependency where one session holds a lock on one table while the other holds a lock on another table.<\/li>\n<li><strong>Root Cause<\/strong>Often, deadlocks stem from application logic that updates tables in different orders. By consistently ordering updates (for example, always update TableA before TableB in every transaction), you can reduce the likelihood of cyclical locks.<\/li>\n<\/ol>\n<h2>6. Best Practices to Avoid or Resolve Deadlocks<\/h2>\n<ul>\n<li><strong>Consistent Locking Order<\/strong>Ensure that all queries or procedures acquire locks in the same order (e.g., always update TableA, then TableB).<\/li>\n<li><strong>Keep Transactions Short<\/strong>The less time you hold locks, the less likely you\u2019ll encounter a deadlock.<\/li>\n<li><strong>Use Proper Indexes<\/strong>Well-designed indexes help queries acquire locks on fewer rows, reducing contention.<\/li>\n<li><strong>Retry Logic<\/strong>In applications, implement a retry mechanism for deadlock victims. A short pause and retry can often succeed once the other transaction completes.<\/li>\n<\/ul>\n<h2>Accessing the system_health Event Output<\/h2>\n<ul>\n<li><strong>SQL Server Management Studio (SSMS) Extended Events UI<\/strong>\n<ul>\n<li>In Object Explorer, expand <strong>Management<\/strong> &gt; <strong>Extended Events<\/strong> &gt; <strong>Sessions<\/strong>.<\/li>\n<li>Right-click <strong>system_health<\/strong> and choose <strong>Watch Live Data<\/strong> (or <strong>View Target Data<\/strong> if available).<\/li>\n<li>Filter or search for <strong>xml_report<\/strong> events that contain the deadlock XML.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>By reviewing these deadlock reports, you can pinpoint the processes, resources, and queries involved, then make changes to prevent or reduce future deadlocks.<\/p>\n<h2>Final Thoughts<\/h2>\n<p>Deadlocks are a normal occurrence in high-concurrency systems but must be managed effectively. The <strong>system_health<\/strong> Extended Events session captures snapshots of the involved processes, locks, and queries. By understanding how to read the <code>&lt;deadlock&gt;<\/code> XML, you can troubleshoot and optimize your SQL Server environment for better concurrency and fewer unexpected rollbacks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[35,12,324,91,73],"tags":[453,450,451,353,452,131,402,448,449],"class_list":["post-942","post","type-post","status-publish","format-standard","hentry","category-data-integrity","category-internals","category-locking","category-query-optimization","category-troubleshooting","tag-concurrency-issues","tag-database-troubleshooting","tag-deadlock","tag-extended-events","tag-locking-mechanisms","tag-sql-server","tag-sql-server-management-studio","tag-system_health","tag-xml-deadlock-report"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Reading SQL Server&#039;s XML Deadlock Report Captured by the system_health Event - SQL Table Talk<\/title>\n<meta name=\"description\" content=\"SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqltabletalk.com\/?p=942\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Reading SQL Server&#039;s XML Deadlock Report Captured by the system_health Event - SQL Table Talk\" \/>\n<meta property=\"og:description\" content=\"SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltabletalk.com\/?p=942\" \/>\n<meta property=\"og:site_name\" content=\"SQL Table Talk\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-03T15:43:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-03T15:43:08+00:00\" \/>\n<meta name=\"author\" content=\"Stephen Planck\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stephen Planck\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=942#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=942\"},\"author\":{\"name\":\"Stephen Planck\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"headline\":\"Reading SQL Server&#8217;s XML Deadlock Report Captured by the system_health Event\",\"datePublished\":\"2025-01-03T15:43:00+00:00\",\"dateModified\":\"2025-01-03T15:43:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=942\"},\"wordCount\":789,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"keywords\":[\"Concurrency Issues\",\"Database Troubleshooting\",\"Deadlock\",\"Extended Events\",\"Locking Mechanisms\",\"SQL Server\",\"SQL Server Management Studio\",\"system_health\",\"XML Deadlock Report\"],\"articleSection\":[\"Data Integrity\",\"Internals\",\"Locking\",\"Query Optimization\",\"Troubleshooting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=942#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=942\",\"url\":\"https:\/\/www.sqltabletalk.com\/?p=942\",\"name\":\"Reading SQL Server's XML Deadlock Report Captured by the system_health Event - SQL Table Talk\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\"},\"datePublished\":\"2025-01-03T15:43:00+00:00\",\"dateModified\":\"2025-01-03T15:43:08+00:00\",\"description\":\"SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=942#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=942\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=942#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltabletalk.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Reading SQL Server&#8217;s XML Deadlock Report Captured by the system_health Event\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\",\"url\":\"https:\/\/www.sqltabletalk.com\/\",\"name\":\"SQL Table Talk\",\"description\":\"Breaking Down SQL Server, One Post at a Time.\",\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltabletalk.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\",\"name\":\"Stephen Planck\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"caption\":\"Stephen Planck\"},\"logo\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/dexterwiki.com\",\"https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI\",\"https:\/\/www.youtube.com\/linuxmate\"],\"url\":\"https:\/\/www.sqltabletalk.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Reading SQL Server's XML Deadlock Report Captured by the system_health Event - SQL Table Talk","description":"SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqltabletalk.com\/?p=942","og_locale":"en_US","og_type":"article","og_title":"Reading SQL Server's XML Deadlock Report Captured by the system_health Event - SQL Table Talk","og_description":"SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.","og_url":"https:\/\/www.sqltabletalk.com\/?p=942","og_site_name":"SQL Table Talk","article_published_time":"2025-01-03T15:43:00+00:00","article_modified_time":"2025-01-03T15:43:08+00:00","author":"Stephen Planck","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stephen Planck","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqltabletalk.com\/?p=942#article","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/?p=942"},"author":{"name":"Stephen Planck","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"headline":"Reading SQL Server&#8217;s XML Deadlock Report Captured by the system_health Event","datePublished":"2025-01-03T15:43:00+00:00","dateModified":"2025-01-03T15:43:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqltabletalk.com\/?p=942"},"wordCount":789,"commentCount":0,"publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"keywords":["Concurrency Issues","Database Troubleshooting","Deadlock","Extended Events","Locking Mechanisms","SQL Server","SQL Server Management Studio","system_health","XML Deadlock Report"],"articleSection":["Data Integrity","Internals","Locking","Query Optimization","Troubleshooting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqltabletalk.com\/?p=942#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqltabletalk.com\/?p=942","url":"https:\/\/www.sqltabletalk.com\/?p=942","name":"Reading SQL Server's XML Deadlock Report Captured by the system_health Event - SQL Table Talk","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/#website"},"datePublished":"2025-01-03T15:43:00+00:00","dateModified":"2025-01-03T15:43:08+00:00","description":"SQL Server includes an Extended Events session called system_health, which runs by default and, among other things, captures information about deadlocks as they occur. When two or more sessions block each other in such a way that no progress can be made (a deadlock), SQL Server chooses one session as the \u201cvictim,\u201d rolls back its transaction, and frees resources so other sessions can continue. By reviewing the deadlock report in the system_health session\u2019s XML output, you can see precisely why the deadlock happened and identify which queries or procedures were involved.","breadcrumb":{"@id":"https:\/\/www.sqltabletalk.com\/?p=942#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltabletalk.com\/?p=942"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltabletalk.com\/?p=942#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltabletalk.com\/"},{"@type":"ListItem","position":2,"name":"Reading SQL Server&#8217;s XML Deadlock Report Captured by the system_health Event"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltabletalk.com\/#website","url":"https:\/\/www.sqltabletalk.com\/","name":"SQL Table Talk","description":"Breaking Down SQL Server, One Post at a Time.","publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltabletalk.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0","name":"Stephen Planck","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","caption":"Stephen Planck"},"logo":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/dexterwiki.com","https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI","https:\/\/www.youtube.com\/linuxmate"],"url":"https:\/\/www.sqltabletalk.com\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=942"}],"version-history":[{"count":3,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/942\/revisions"}],"predecessor-version":[{"id":946,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/942\/revisions\/946"}],"wp:attachment":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}