Article ID: 288957 - Last Review: November 6, 2003 - Revision: 3.1 FIX: Multiple Calls To a User Defined Function Within an Aggregate Function May Return Incorrect ResultsThis article was previously published under Q288957
BUG #: 236595 (SHILOH_BUGS)
On This PageSYMPTOMS
SQL Server may return incorrect results for a query if all of the following conditions are true:
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
(http://support.microsoft.com/kb/290211/EN-US/
)
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. MORE INFORMATION
The following example demonstrates the problem.
| Article Translations
|

Back to the top
