Article ID: 179222 - Last Review: March 14, 2006 - Revision: 4.0

FIX: UPDLOCK Locking Option Sets Only Shared Lock with sp_cursor

This article was previously published under Q179222
BUG #: 16273 (NT: 6.5)
Expand all | Collapse all

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  (http://support.microsoft.com/kb/197177/ ) INF: How to Obtain SQL Server 6.5 Service Pack 5a
For more information, contact your primary support provider.

APPLIES TO
  • Microsoft SQL Server 6.5 Standard Edition
Keywords: 
kbbug kbfix KB179222
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations