FIX: Complex Update Statement Returns 8624 Internal SQL Server Error

Article translations Article translations
Article ID: 286249 - View products that this article applies to.
BUG #: 351305 (SHILOH_bugs)
Expand all | Collapse all

Symptoms

An UPDATE statement that contains a subquery, which selects from a derived table formed from a UNION ALL, may generate the following error message:
Server: Msg 8624, Level 16, State 21, Line 2
Internal SQL Server error.

Resolution

To 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

Workaround

If possible, rewrite the query by using only the UNION operator, without the ALL keyword.

Status

Microsoft 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

To reproduce this error, run this script:
CREATE TABLE MaxCol(
PK INT PRIMARY KEY,
f1 INT,
f2 INT,
mx INT
)
GO

UPDATE MaxCol
SET mx =
    (SELECT MAX(f)
    FROM
        (
        SELECT f1 AS f
        FROM MaxCol AS A
        WHERE A.PK=MaxCol.PK
        UNION ALL
        SELECT f2
        FROM MaxCol AS B
        WHERE B.PK=MaxCol.PK
        ) AS TU
    )
				

Properties

Article ID: 286249 - Last Review: June 22, 2014 - Revision: 4.0
Applies to
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbbug kbfix kbsqlserv2000sp1fix KB286249

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com