BUG: Declare Cursor May Fail with Memory Error 702

ID: Q167609


The information in this article applies to:

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:


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

Last Reviewed: April 9, 1999