BUG: "If" or "Where Exists" Statements Report Syntax Error

ID: Q151609


The information in this article applies to:
  • Microsoft SQL Server version 6.0


SYMPTOMS

If an "If Exists" or "Where Exists" statement returns more than one column, it will report a syntax error near a comma (,).


CAUSE

The following statement will cause the error:


if exists(select au_lname, au_fname from authors)
   print 'if'
else
   print 'else' 


WORKAROUND

If you change the statement to only return au_lname, the query will successfully compile.


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.0. This problem does not occur in Microsoft SQL Server version 6.5.

Keywords : kbbug6.00
Version : 6.0
Platform : WINDOWS
Issue type :


Last Reviewed: March 26, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.