FIX: Error 701/Server Unresponsive on Cursor Queries w/UPDATE

Last reviewed: April 9, 1997
Article ID: Q158486
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5
BUG #: 15553 (Windows NT: 6.0)
       15624 (6.5)

SYMPTOMS

When you run cursor queries that do an UPDATE using the WHERE CURRENT OF <cursor> clause, the server runs out of memory, even though the cursors are closed properly. This leads to the following error message (701):

   There is insufficient system memory to run this query.

After that, the server becomes very slow for normal connections.

CAUSE

Cursor operations that do an UPDATE using the WHERE CURRENT OF <cursor> cause a memory leak. One page of memory allocated on each call is not reclaimed until the connection is dropped.

WORKAROUND

To work around this problem, do either of the following:

  • Avoid using the UPDATE WHERE CURRENT OF <cursor> clause. Instead, you can use "positioned" updates (calling sp_cursor or using SQLSetPos in ODBC).

    -or-

  • Identify and close the connection that caused the error 701 message. Normally, the client connection that caused this problem runs into the error 701, and can be identified easily. When this connection is closed, everything returns to normal.

STATUS

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

MORE INFORMATION

The server eventually comes to a very slow, unusable state from which it must be recycled.

The following is additional information for SQL Server version 6.5:

   If SQLTrace is running, no new connections to the server are possible.

The following is additional information for SQL Server version 6.0:

   The error 701 sometimes leads to a handled access violation (AV).


Additional query words: cursors memory leak av
Keywords : kbbug6.00 kbbug6.50 kbfix6.50.sp2 kbprg SSrvProg
Version : 6.0 6.5
Platform : WINDOWS
Issue type : kberrmsg


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