BUG: Declare Cursor May Fail with Memory Error 702

Last reviewed: April 28, 1997
Article ID: Q167609
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 16713 (Windows NT: 6.5)

SYMPTOMS

A declare cursor statement with a select list consisting of a number of coalesce statements may fail with message 702, "memory request exceeds size of a page."

WORKAROUND

To work around this problem, select into a temporary table and declare the cursor on the temporary table.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The scenario tested in this case had 26 coalesce statements involving the aggregate function sum, as in the following:

   coalesce(sum(x),0)

The select list also included two more columns; however, the total length of all columns did not exceed 1,962 bytes. The where clause had four conditions anded together, and there was a group by.

When run outside of the declare cursor, the select statement ran to completion.

Testing showed that the type of cursor does not matter, nor does replacing coalesce with searched case. However, the error did not happen if one of the following was done:

  • One of the columns in the select clause was removed.
  • The group by was removed.
  • All coalesce statements were removed from all columns.
  • One condition in the where clause was sacrificed.


Keywords : kbbug6.50 kbusage SSrvGen
Version : 6.5
Platform : WINDOWS
Issue type : kbbug
Resolution Type : kbworkaround


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