Microsoft KB Archive/149346

{|
 * width="100%"|

BUG: Declare Cursor May Be Ignored With Correlated Subquery

 * }

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 : kbprogramming

Issue type : kbbug

Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600