Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 10th, 2003, 09:38 AM
ak ak is offline
Authorized User
 
Join Date: Sep 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Server deadlocks

Hi All
The error received:
[Microsoft][ODBC SQL Server Driver][SQL Server]Transaction
(Process ID 73) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

any suggestion on how to avoid this in future?
it came about in asp pages running stored procedures.
is it possible to find the cause of this deadlock?

thank for any advise...
akthar


ak
__________________
ak
 
Old September 10th, 2003, 10:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Take a look at this post in the archive http://p2p.wrox.com/topic.asp?TOPIC_ID=3159
 
Old September 10th, 2003, 10:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

See also http://p2p.wrox.com/topic.asp?TOPIC_ID=3360

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old September 12th, 2003, 03:47 AM
ak ak is offline
Authorized User
 
Join Date: Sep 2003
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jeff Mason and PGTIPS thanks for your help
...how would i recognise which objects are causing the dead locks ?
When a lock occures, I am trying to track the objects involved in the lock.


ak
 
Old September 12th, 2003, 06:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

It can be difficult to identify the offending objects, as you have to catch the deadlock actually happening. If you can, there are a few ways to view the lock activity. Be aware, though, that any way you do it may mean that you may have to sift through mountains of output, especially if your server is busy or heavily loaded (which is probably only when the deadlock occurs :( ), so this may not be for the faint of heart...

You can use EM; select the server, then Management -> Current Activity -> Locks. This will display information about the process, which locks they hold, and the last SQL statement they executed.

You can use the stored procedures sp_who2 and sp_lock. sp_who2 will identify the processes involved in blocking, and sp_lock will tell you why they are blocked.

You can set trace flag 1204 and get very detailed info about the processes involved and what they were doing. See BOL index for 'trace flag 1204' to see how to do this and for other info on identifying deadlock situations.


Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conflict in SQL Server 2000 and SQL Server 2005 ayan.mukherjee SQL Language 0 June 30th, 2008 03:34 AM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
migrating from sql server 2000 to sql server 2005 abinashpatra SQL Server 2005 2 December 1st, 2006 03:45 PM
Sql server deadlocks and RAID manupuri SQL Server 2000 0 June 28th, 2004 01:27 AM
Deadlocks in WebService performance [email protected] .NET Web Services 0 October 16th, 2003 01:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.