Question

After migrating data from SQL Server 2000 to SQL Server 2008, when I am doing any a transaction in the table which find out more row on the database, that's gives me error.

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

There are 3 triggers on the table (Insert,Update,Delete). How can I solve this problem?

Was it helpful?

Solution

After upgrading to SQL Server 2008, did you run the below?

  1. DBCC UPDATEUSGAE
  2. UPDATE STATS WITH FULLSCAN
  3. REBUILD ALL INDEXES

The statistics blob is changed significantly from 2000 to SQL Server 2008 and the above steps are very important after the upgrade. I have seen many ppl run into performance problems but not deadlocks. I would try doing all of the above if you haven't so far and try to reproduce the problem afterwards.

That said, what is the results of SELECT @@VERSION on the 2008 box? Are you updating one row or several rows?

OTHER TIPS

I suspect that this may be related to the optimizers in the different versions handling lock escalation differently. Can you check for Lock:Escalation events?

IF you run Profiler and record all deadlock graphs then you can find out exactly which tables the deadlocks occur on, including pages. That should help narrow it down.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top