Handling Deadlocks

  • I have one procedure which is run parallely multiple times to insert data into one table for different set of parameters. I can see my process getting deadlocked.

  • What about posting the code?

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • Not possible - there I am first selecting data from a big table to temporary table, then doing some updates and finally inserting it back to the main table. This all is happening using sp_executesql. Transaction is started in the beginning of procedure and committed at last.

  • Without the code and the deadlock graph it's impossible to give any useful advice.

    Get the deadlock graph (via traceflag 1222 or via the extended events system health session), look at the the statements involved, look at the resources involved and based on that decide how you're going to proceed. Could be adding or widening indexes, could be changing code.

    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

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

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