BUG: Declare Cursor May Be Ignored With Correlated Subquery

Last reviewed: May 2, 1997
Article ID: Q149346

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
BUG#: 13940 (6.00)

SYMPTOMS

A batch containing a declare cursor that contains certain correlated subqueries will be ignored. No error messages are generated, but none of the commands in the batch are executed.

STATUS

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

WORKAROUND

The type of query that encounters the error is:

DECLARE fred scroll CURSOR for select ( select max(t2.type) from titles t2 where t2.pub_id <> 1.pub_id) from titles t1 go

This can be recoded:

DECLARE fred scroll CURSOR for select max(t2.type) from titles t1 , titles t2 where t1.pub_id <> t2.pub_id group by t1.title_id go


Additional query words: cursor sql6
Keywords : kbbug6.00 kbprg SSrvProg
Version : 6.0
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: May 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.