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

Q151609


The information in this article applies to:


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 :
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600


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