FIX: UPDLOCK Locking Option Sets Only Shared Lock with sp_cursor

ID: Q179222


The information in this article applies to:
  • Microsoft SQL Server version 6.5

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 version 6.5. This problem has been corrected in U.S. Service Pack 5a for Microsoft SQL Server version 6.5. For information about downloading and installing the latest SQL Server Service Pack, see http://support.microsoft.com/support/sql/.

For more information, contact your primary support provider.

Additional query words:

Keywords : SSrvTran_SQL kbbug6.50 kbfix6.50.SP5
Version : winnt:6.5
Platform : winnt
Issue type : kbbug


Last Reviewed: November 17, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.