BUG: A SELECT Statement With a Number of SUM(CASE()) Expressions and UNIONs May Cause Stack Overflow (268846)
The information in this article applies to:
This article was previously published under Q268846
BUG #: 57937(SQLBUG_70)
SYMPTOMS
A query that contains a number of SUM(CASE()) expressions along with UNION statements in a subquery might result in a stack overflow exception.
The query might fail with the following error message:
Connection Broken
You may also get a message that indicates that the command completed successfully but you might not get the expected results.
CAUSE
The query processor duplicates the list of correlation variables many times and causes the stack overflow.
WORKAROUND
Re-write the query so that it has less UNION statements, or eliminate the UNION statements altogether.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0.
Modification Type: | Major | Last Reviewed: | 10/16/2002 |
---|
Keywords: | kbBug KB268846 |
---|
|