1SELECT
2 xed.value('@timestamp', 'datetime2(3)') as CreationDate,
3 xed.query('.') AS XEvent
4FROM
5(
6 SELECT CAST([target_data] AS XML) AS TargetData
7 FROM sys.dm_xe_session_targets AS st
8 INNER JOIN sys.dm_xe_sessions AS s
9 ON s.address = st.event_session_address
10 WHERE s.name = N'system_health'
11 AND st.target_name = N'ring_buffer'
12) AS Data
13CROSS APPLY TargetData.nodes('RingBufferTarget/event[@name="xml_deadlock_report"]') AS XEventData (xed)
14ORDER BY CreationDate DESC