BUG: SPs w/ Aggregate Functions in HAVING Clause can Cause AVs

ID: Q199720


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

BUG #: 16906 (SQLBUG_65)

SYMPTOMS

Running a stored procedure that meets the following conditions can cause handled exceptions or result in message 107:

  • The stored procedure has an aggregate in its HAVING clause.


  • The underlying table on which this having clause depends is dropped and recreated.


The text of this error message is:
Msg 107: The column prefix '' does not match with a table name or alias name used in the query.
Recompiling the stored procedure does not eliminate the problem, and neither does creating the procedure with the 'WITH RECOMPILE' option.


WORKAROUND

Drop and recreate the stored procedure


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5.

Additional query words:

Keywords : SSrvISQL SSrvTran_SQL kbbug6.50 kbSQLServ650bug
Version : winnt:6.5
Platform : winnt
Issue type : kbbug


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