Quick deadlock question

  • Hi all,

    I have a question regarding deadlock trace output. I had always thought that "Statement Type" meant the type of statement being executed, however the information on this page: http://msdn.microsoft.com/en-us/library/ms178104.aspx leads me to believe that it is actually the maximum permissions the spid in question has. In this example, the query being performed is an Insert but statement type is being reported as a delete:

    Node:1

    PAGE: 63:1:15535 CleanCnt:3 Mode:U Flags: 0x2

    Grant List 0:

    Owner:0x00000000ED321040 Mode: U Flg:0x0 Ref:0 Life:00000001 SPID:122 ECID:0 XactLockInfo: 0x00000000FCAC76E8

    SPID: 122 ECID: 0 Statement Type: DELETE Line #: 6 Input Buf: Language Event: (@p0 int,@p1 bit,@p2 bit,@p3 bit,@p4 bit,@p5 nvarchar(4000),@p6 nvarchar(4000),@p7 nvarchar(5),@p8 nvarchar(14),@p9 nvarchar(13),@p10 nvarchar(7),@p11 nvarchar(4000),@p12 nvarchar(13),@p13 nvarchar(1),@p14 nvarchar(4000))INSERT INTO forward.Individual (Ve

    Requested By:

    ResType:LockOwner Stype:'OR'Xdes:0x00000000CCDA8870 Mode: U SPID:121 BatchID:0 ECID:1 TaskProxy:(0x00000000A2E09830) Value:0xf50c76c0 Cost:(0/16332)

    The MS definition of Statement Type is:

    Statement Type. Describes the type of DML statement (SELECT, INSERT, UPDATE, or DELETE) on which the threads have permissions.

    Can anyone confirm what Statement type is referring to? The actual DML of the statement being executed or the max DML permission of the spid executing the statement?

    Thanks!

    Adam

  • Hi,

    the input buffer is the whole batch not the single statement that caused the deadlock. Try to find the whole batch in your code and verify if there is an DELETE-Statement in it.

    From the msdn-website:

    Input Buf (inputbuf for trace flag 1222). Lists all the statements in the current batch.

    Greets

    [font="Arial"]Kind regards,

    Patrick Fiedler
    Consultant

    Fiedler SQL Consulting

    www.fiedler-sql-consulting.de
    [/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply