5

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?

2
  • @Gaius not by my experience on meta
    – jcolebrand
    Commented Apr 28, 2011 at 16:25
  • @jcolebrand cool
    – Gaius
    Commented Apr 28, 2011 at 19:02

3 Answers 3

2

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?

1
  • First of all,thanks for your answer.BTW , the result of SELECT @@VERSION --> (No column name) Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    – Cell-o
    Commented Apr 21, 2011 at 13:32
1

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?

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.