Microsoft KB Archive/179222

= FIX: UPDLOCK Locking Option Sets Only Shared Lock with sp_cursor =

Article ID: 179222

Article Last Modified on 3/14/2006

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q179222



BUG #: 16273 (NT: 6.5)



SYMPTOMS
If you open a KEYSET cursor with the locking option UPDLOCK through sp_cursoropen in a transaction, only a shared lock is set on the pages with the qualifying data rows. With the first sp_cursorfetch, an Update_page lock is set.

This leads to a good chance to run into a deadlock.



WORKAROUND
To work around this problem, do either of the following:
 * Use a DYNAMIC or FORWARD-ONLY cursor.

-or-
 * Use TABLOCK or HOLDLOCK instead of UPDLOCK as optional optimizer hints in the FROM clause.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a

For more information, contact your primary support provider.

Keywords: kbbug kbfix KB179222

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.