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



The information in this article applies to:

  • Microsoft SQL Server 6.5

This article was previously published under Q191809
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.


Modification Type:MajorLast Reviewed:10/3/2003
Keywords:kbBug kbpending KB191809