Article ID: 290817 - View products that this article applies to.
This article was previously published under Q290817
BUG #: 352229 (SHILOH)
BUG #: 101227 (SQLBUG_70)
If you submit a query that contains an aggregate or other computed column inside of a subquery, SQL Server may return error 8624 while attempting to optimize the query. The error message is:
The query will not run, and it is not possible to see the SHOWPLAN_ALL or SHOWPLAN_TEXT output for the query.
Server: Msg 8624, Level 16, State 8, Line 1
Internal SQL Server error.
Service pack informationTo resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/290211/ )How to obtain the latest SQL Server 2000 service pack
Hotfix informationA supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.
If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=supportNote The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.
Version File name ---------------------- 8.00.0258 S80258i.exe
If the computed expression is a MIN(<column>) or MAX(<column>) aggregate, you can replace the aggregate with a TOP 1 <column> ... ORDER BY <column> ASC or ORDER BY <column> DESC clause, respectively.
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
The state reported in the error message indicates where in the code that this particular error occurs. For example, the state for this error is eight (8). This particular fix only addresses 8624 errors where the state is eight.
The following code sample demonstrates the problem, as well as the suggested workaround of using TOP.