Answers for "how to check current deadlock in sql server"

SQL
1

sql check deadlock query

SELECT
   xed.value('@timestamp', 'datetime2(3)') as CreationDate,
   xed.query('.') AS XEvent
FROM
(
   SELECT CAST([target_data] AS XML) AS TargetData
   FROM sys.dm_xe_session_targets AS st
      INNER JOIN sys.dm_xe_sessions AS s
         ON s.address = st.event_session_address
      WHERE s.name = N'system_health'
         AND st.target_name = N'ring_buffer'
) AS Data
CROSS APPLY TargetData.nodes('RingBufferTarget/event[@name="xml_deadlock_report"]') AS XEventData (xed)
ORDER BY CreationDate DESC
Posted by: Guest on February-19-2021
0

mssql find deadlocks

--[status]
EXEC sp_whoisActive;
Posted by: Guest on January-23-2020

Code answers related to "how to check current deadlock in sql server"

Code answers related to "SQL"

Browse Popular Code Answers by Language