FIX: Descending Index Scans May Block with High Transaction Isolation

Article translations Article translations
Article ID: 196919 - View products that this article applies to.
This article was previously published under Q196919
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 52498
Expand all | Collapse all


A descending index scan with a SERIALIZABLE transaction isolation level or a HOLDLOCK hint can hold a lock that prevents inserts greater than the highest value current in the table for the index the scan is performed on.


To work around this problem, do not use descending index scans when using a SERIALIZABLE transaction isolation level or a HOLDLOCK hint.


Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 1 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
232570INF: How to Obtain Service Pack 1 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.


The following example queries clarify this problem:

--query 1:
   create table t(x int primary key)
   insert into t values(0)
   insert into t values(2)
   insert into t values(3)
   insert into t values(4)
   insert into t values(6)
   set transaction isolation level serializable
   begin transaction
   select * from t where x < 3 order by x desc
--query 2: Run from another connection
   insert into t values(1) -- blocked as expected
--query 3: Run from another connection
   insert into t values(5) -- works
   insert into t values(7) -- blocked until query 1 client releases locks
The following is the problem lock as reported by the sp_lock stored procedure:

   spid   dbid   ObjId       IndId  Type Resource         Mode     Status
   ------ ------ ----------- ------ ---- ---------------- -------- ------

   7      5      1365579903  1      KEY  (ffffffffffff)   IS-S     GRANT


Article ID: 196919 - Last Review: October 11, 2013 - Revision: 2.1
  • Microsoft SQL Server 7.0 Standard Edition
kbnosurvey kbarchive kbbug kbfix kbsqlserv700sp1fix KB196919

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from