![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
We have a SQL 2000 database, this morning a job than run simple update on a table with 18,000 rows kept running for two hours (normally it takes about couple seconds) I tried to find spid that was causing the block, Under SQL EM under current activity, found that spid that was blocking to my surprise it was a select statement. I killed that spid and update ran fine afterwords. Based on my understanding SELECT takes a shared lock, not exclusive but can it starv the update for two hours. |
#3
| |||
| |||
|
#4
| |||
| |||
|
#5
| |||
| |||
|
|
We have a SQL 2000 database, this morning a job than run simple update on a table with 18,000 rows kept running for two hours (normally it takes about couple seconds) I tried to find spid that was causing the block, Under SQL EM under current activity, found that spid that was blocking to my surprise it was a select statement. I killed that spid and update ran fine afterwords. Based on my understanding SELECT takes a shared lock, not exclusive but can it starv the update for two hours. |
#6
| |||
| |||
|
|
Yes, a select can block an update depending on the isolation level. |
#7
| |||
| |||
|
|
Yes, a select can block an update depending on the isolation level. Here is a link to the SQL Server 2000 BOL topic: http://msdn.microsoft.com/en-us/libr...6(SQL.80).aspx Selecting in the READ UNCOMMITTED isolatino level, or using the NOLOCK hint, is the least restrictive locking, but as the notes explain, it has its downsides as well. You have to use your good judgment on whether those downsides are compatible with the purpose of the select. Of course, things go wrong, but why was the select running for two hours? Was it a problem with the code? The connection? Etc? RLF "css" <css (AT) discussions (DOT) microsoft.com> wrote in message news:7E1B3CAA-1A95-4986-BFE8-F23258A77A24 (AT) microsoft (DOT) com... We have a SQL 2000 database, this morning a job than run simple update on a table with 18,000 rows kept running for two hours (normally it takes about couple seconds) I tried to find spid that was causing the block, Under SQL EM under current activity, found that spid that was blocking to my surprise it was a select statement. I killed that spid and update ran fine afterwords. Based on my understanding SELECT takes a shared lock, not exclusive but can it starv the update for two hours. |
#8
| |||
| |||
|
|
Russell, It looks like there are some processes that transfer data to SAP and this select was part of it and one of those processes failed. Yes, a select can block an update depending on the isolation level. Just curious, what isolation level can cause SELECT to block (repeatable read or serializable?) |
#9
| |||
| |||
|
|
We have a SQL 2000 database, this morning a job than run simple update on a table with 18,000 rows kept running for two hours (normally it takes about couple seconds) I tried to find spid that was causing the block, Under SQL EM under current activity, found that spid that was blocking to my surprise it was a select statement. I killed that spid and update ran fine afterwords. Based on my understanding SELECT takes a shared lock, not exclusive but can it starv the update for two hours. |
![]() |
| Thread Tools | |
| Display Modes | |
| |