I have setup extended event session with the following event: xml_deadlock_report
When I look at the deadlock graph, it shows me the processes asking or requesting for the resource, and the type of locks requested and owned by the respective process. Hovering over the process shows me the SQL text. I can also see more details and export the xml/xdl.
However, the SQL text shown is the query in the buffer at the time of the deadlock. This is not the same as the query that owns/requests the lock. I want to see the actual SQL query in this process that owns the lock or is requesting for the lock.
Is there a way to capture the exact SQL text involved in deadlock (locks) using extended events?