Deadlock error

  • Hi,

    I am getting the below deadlock error whenever I tried to execute my stored procedure.

    "Transaction (Process ID XX) was deadlocked on thread | communication buffer resources with another process and has been chosen as the deadlock victim.".

    I tried to set the deadlock priority like this in the stored procedure: SET DEADLOCK_PRIORITY NORMAL;. But no luck.

    Can anybody please provide your suggestions to avoid this deadlock error. Please help me very urgent.

    Thanks in advance.

    Madhuri

  • Enable traceflag 1222. That will write a deadlock graph into the error log whenever a deadlock occurs. Post it here.

    Most deadlocks are a result of non-optimal code or non-optimal indexes or both.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • u need to upload the stored proc at least so we can see if there is something obvious.

  • do the DBCC inputbuffer(spid) and see the code.

    Execute the code by enabling execution plan and see the cost of query.

    most probably you will be able to trace the problem.

    ----------
    Ashish

Viewing 4 posts - 1 through 3 (of 3 total)

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