FIX: Error 16934 If Sp_cursor Update on Sproc After Dump/Load

Last reviewed: June 27, 1997
Article ID: Q164056
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 16515 (6.5)

SYMPTOMS

You may receive the following error 16934 when performing an optimistic lookup:

   Optimistic concurrency check failed, the row was modified outside of
   this cursor.

This problem may occur if you do all of the following:
  • Dump and load a database containing a stored procedure into a different database.
  • Declare an extended keyset or dynamic cursor on that stored procedure.
  • Do an sp_cursor positioned update using CU_OPTCC (optimistic check by value or timestamp) or CU_OPTCCVAL (optimistic check by value).

This problem does not occur if the database is dumped and loaded back to the same database.

WORKAROUND

After the dump and load to a different database, drop and re-create the stored procedure on which the cursor is declared.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

MORE INFORMATION

Error message 16934 is not intrinsically wrong. It merely indicates that during a cursor read, browse, or update operation, the optimistic lookup detected a changed row. However, in this particular case, error 16934 is wrong because no update to the underlying row took place.

SQL Server supports two different server-side cursor interfaces. One is ANSI SQL cursors, exposed through Transact-SQL statements such as DECLARE, FETCH, and so on. There is also an extended cursor interface that is accessed by means of the DB-Library and ODBC APIs. The sp_cursor extended cursor statements are emitted by the DB-Library or ODBC layers in response to certain DB-Library or ODBC API calls. Higher-level interfaces such as Remote Data Objects (RDO) often encapsulate these API-level calls, so you would need to run a trace utility such as SQL Trace to verify the sp_cursor call being made.

For more information on cursors and concurrency modes, see the on-line documentation and the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q156489
   TITLE     : Overview of SQL Server, ODBC, and DB-Library Cursors
 

	
	


Keywords : kbbug6.50 kbusage SSrvDB_Lib SSrvGen SSrvTran_SQL
Version : 6.5
Platform : WINDOWS


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: June 27, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.