Re: Locking
From: Andrew J. Kelly (sqlmvpnooospam_at_shadhawk.com)
Date: 02/20/04
- Next message: Andrew J. Kelly: "Re: STORED PROCEDURE"
- Previous message: Vishal Parkar: "Re: How to findout Eliminated record by when use Distinct function"
- In reply to: Justin: "Locking"
- Next in thread: Billy Yao [MSFT]: "Re: Locking"
- Reply: Billy Yao [MSFT]: "Re: Locking"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 20 Feb 2004 08:05:23 -0500
A deadlock is when two users attempt to update 2 tables in opposite orders
and neither can complete because they are waiting on the other to release
it's locks. When this happens sql server automatically detects it and will
kill one of the users. So if your app is slow and waiting it is not
deadlocks but rather blocking. Here are some links on this:
http://www.support.microsoft.com/?id=224453 Blocking Problems
http://www.support.microsoft.com/?id=271509 How to monitor SQL 2000
Blocking
But your simplified scenario does not seem to indicate why there would be an
issue. How many rows are you deleting at one time and how are you doing it?
Do you have proper indexes on the tables? Can you post the code?
-- Andrew J. Kelly SQL Server MVP "Justin" <none> wrote in message news:HMydnX4b1q8dcKjdRVn-uA@is.co.za... > I have a stored proc which reads data out of a table, and deletes it once it > has been read. > At the same time another stored proc is inserting data into the table, > updated fields, and deleting records. > > The problem comes, once the first stored proc is reading from the table, and > the 2nd stored proc executes, and tries to delete a record. A deadlock > occurs, an the SQL box begins to get extremely slow. What is the best way to > avoid this? > > Thanks, > Justin > >
- Next message: Andrew J. Kelly: "Re: STORED PROCEDURE"
- Previous message: Vishal Parkar: "Re: How to findout Eliminated record by when use Distinct function"
- In reply to: Justin: "Locking"
- Next in thread: Billy Yao [MSFT]: "Re: Locking"
- Reply: Billy Yao [MSFT]: "Re: Locking"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|