BUG: Use of COALESCE Function Against a Subquery with an Aggregate Function May Cause Error 8624 (317527)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q317527
BUG #: 356377 (SHILOH_BUGS)
SYMPTOMS
If you use the COALESCE function against a subquery that has an aggregate function, you may encounter the following error message in SQL Server 2000:
Server: Msg 8624, Level 16, State 25, Line 1
Internal SQL Server error.
WORKAROUND
To work around the problem, replace the COALESCE function with the CASE function.
For example:
USE pubs
GO
SELECT CASE WHEN((SELECT SUM(ta.au_ord) from titleauthor ta
WHERE ta.au_id = '172-32-1176' GROUP BY ta.royaltyper) IS NOT NULL)
THEN (SELECT SUM(ta.au_ord) from titleauthor ta
WHERE ta.au_id = '172-32-1176' GROUP BY ta.royaltyper)
ELSE 0
END
GO STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/3/2003 |
---|
Keywords: | kbbug kbpending KB317527 |
---|
|