When I get the deadlock graph xml in SQL Server, it shows me an executionStack for each process, e.g. (I have removed most of the attributes):
<process>
<executionStack>
<frame>INSERT INTO MYTABLE</frame>
<frame>INSERT INTO MYTABLE</frame>
</executionStack>
<inputbuf>INSERT INTO MYTABLE</inputbuf>
</process>
I know the list of frames does not contain all the frames in the transaction, but does it contain all the frames that are implicated in the deadlock, so I do not need to look any further? Or do I need to also examine the preceding sql statements in the same transaction to get a complete picture as to the cause of the deadlock?
Edit: to clarify further, the following can deadlock itself if run in two separate spids:
select * from mytable where column = @arg delete from mytable where column = @arg
Will the deadlock graph show the select statement as well as the delete statement, or only the delete statement because that was the last statement in the transaction? Without seeing the select statement too, it is difficult to identify the correct fix (e.g., updlock hint on the select).