Deadlock vicitm error

  • I am intrigued by a Deadlock error that happens very rarely with message like this.

    Transaction (Process ID 60) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

    I need to know what query (or stored procedure since I use stored proc only to access db) the current transaction was making when deadlock happened and more importantly, which is the other transaction and stored procedure the other transaction is running. Is there any way to find this in SQL Server 2000.

    Can DBA be sent an email when deadlock happens?

    Any help is greatly appreciated.

  • You can use SQL Profiler to monitor the database and view the following events:
     
    Lock : Deadlock Chain  -  To show the events leading up to the deadlock
    Lock : Deadlock           -  To show the deadlock occurrence
     
    You can also use the trace flags T1204, T1205, and T1206 to return very detailed information about deadlocks to the error log in SQL.
     
    I'm not sure how to return deadlock information for events that happened in the past.
     
    Hope this helps
     

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

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