BUG: SELECT from View with UNION ALL and Aggregate Function AVs

ID: Q191809


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

BUG #: 18230 (SQLBUG_65)

SYMPTOMS

You may receive a handled access violation (AV) if all of the following conditions are true:

  • You issue a SELECT statement against a view.

    -and-


  • That view uses UNION ALL to union a SELECT statement containing an aggregate function with another view.

    -and-


  • That other view also contains UNION ALL.



WORKAROUND

To work around this problem, do any one of the following:

  • Change any of the UNION ALL statements to a UNION.

    -or-


  • Eliminate the aggregate function from the SELECT statement in the outer view.

    -or-


  • Execute the Transact-SQL statements that make up the outer view directly (as opposed to selecting from the outer view).



STATUS

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

Additional query words: MIN MAX SUM AVG COUNT

Keywords : kbbug6.50
Version : WINNT:6.5
Platform : winnt
Issue type : kbbug


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