BUG: Delete Using EXISTS & Subquery Doesn't Escalate Page Lock

Last reviewed: November 21, 1997
Article ID: Q177114
The information in this article applies to:
  • Microsoft SQL Server, version 6.5 Service Pack 3
BUG #: 17399 (NT: 6.5)

SYMPTOMS

Deleting a table that includes at least one text or image datatype by using Transact-SQL statements EXISTS or NOT EXISTS and a correlated subquery, will not properly escalate page locks to a table lock. Although sp_lock will show an Ex_table lock on the table, Ex_page locks will continue to be acquired, in excess of the LE threshold, for all pages involved in the deletion. On larger tables, such deletions can exhaust available locks and generate a system message 1204:

   SQL Server has run out of LOCKS.

This is a regression bug for 6.50.258 Service Pack 3 (SP3). The symptoms are not seen in 6.50.201 (base release) or 6.50.240 (SP2).

WORKAROUND

You can work around the problem by using either of these methods:

Separate the correlated subquery from the deletion by using the correlated subquery to move data into a temporary table.

-or-

Use a cursor on a unique index to delete the rows one by one.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5 Service Pack 3. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: correlated escalation escalate decouple
Keywords : kbbug6.50.sp3 SSrvLock
Version : WinNT:6.5.sp3
Platform : winnt
Issue type : kbbug
Solution Type : kbpending kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.