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?

Colin 't Hart
9,51015 gold badges37 silver badges44 bronze badges
asked Apr 20, 2011 at 18:34
2
  • @Gaius not by my experience on meta Commented Apr 28, 2011 at 16:25
  • @jcolebrand cool 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?

answered Apr 20, 2011 at 21:53
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) 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?

answered Apr 20, 2011 at 18:53
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.

answered Apr 21, 2011 at 10:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.