FIX: Multiple Calls To a User Defined Function Within an Aggregate Function May Return Incorrect Results (288957)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q288957
BUG #: 236595 (SHILOH_BUGS)
SYMPTOMS
SQL Server may return incorrect results for a query if all of the following conditions are true:
- The query contains two or more references to the same aggregate function.
- These aggregate functions take as their parameter the results from a call to the same user defined function (UDF).
- The calls to the UDF pass the same first parameter.
- The UDF takes two or more parameters, and the results that it returns are dependent on the value of those secondary parameters.
CAUSE
The optimizer attempts to find duplicate aggregate functions in the query so that each unique aggregate is only calculated once. That code fails to take into account the secondary parameters that are being passed to a UDF and might incorrectly identify two aggregates as equivalent.
RESOLUTIONTo resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
HotfixNOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 1.
The English version of this fix should have the following file attributes or later:
Version File name Platform
-------------------------------------
8.00.251 s80251i.exe x86
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 1.
Modification Type: | Major | Last Reviewed: | 11/6/2003 |
---|
Keywords: | kbBug kbfix kbQFE kbSQLServ2000sp1fix KB288957 |
---|
|