Microsoft KB Archive/194664

= FIX: Errors with Procedures Containing Aggregates and a HAVING Clause =

Article ID: 194664

Article Last Modified on 3/14/2006

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q194664



BUG #: 16906 (SQLBUG_65)



SYMPTOMS
A stored procedure that contains an aggregate in the HAVING clause may cause error 107 or a handled access violation (AV) if the procedure must be recompiled or reresolved. The procedure will be recompiled when the server is restarted or the procedure is otherwise flushed from cache, or when the WITH RECOMPILE clause is used. A reresolution occurs when a schema change is made to any of the objects referenced in the stored procedure.

The following is error 107:

Msg 107: The column prefix '' does not match with a table name or alias name used in the query.



WORKAROUND
To avoid the error 107 or handled access violation, do not use an aggregate in the HAVING clause. As an alternative, you can drop and re-create the procedure after starting the server or after schema changes are made to any of the underlying objects.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a

For more information, contact your primary support provider.

Additional query words: prodsql

Keywords: kbbug kbfix KB194664

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.