SQL Transaction deadlock

  •  

    Has anyone ever seen this error?  I get this error about 40-50% of the time when I run a certain script.

     

    [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction (Process ID 12) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

    Multiple people run this same script throughout the day, could this be the reason?

     

    thank you

     

     

  • Very likely.

    Is the script holding locks during its executions?

    Any cursors?

     

  • Run with trace flags 1204, 1205 and 3605 on and look at the deadlock trace file that gets generated.  It will give you an idea about what is going wrong with the script.

  • Hi guys...

     

    no cursors....

     

    how do you run a query with trace flags on, especially from an ASP script?  Or do I have to use sql server query analyzer?

    Thank you

     

     

  • It may happen that which script you are using

    contains such objects (i.e. tables or views or procedures) are accessed by some transactions.

    In that case you have to first kill the process of such transactions.

    first go to enterprise manager.

    click on sever.

    click management

    and then click on current activity.

    and then select process id and kill the process which has been blocked.

    if you unable to kill such process then re start your server.

     

     

     

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

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