The information in this article applies to:
SYMPTOMS
In an update statement, if you use a subquery to set the value of a
column and include one or more aggregate functions with arithmetic
operations, an error occurs complaining that the subquery returns
multiple values, even if it does not.
However, the following query, without the arithmetic operation (*1), runs without error:
CAUSESQL Server incorrectly handles arithmetic operations in a subquery that returns aggregate results if the subquery updates a table. WORKAROUNDOne workaround is to move the constant inside the parentheses if the query remains semantically correct. For example, you can rewrite sum(c)*2 as sum(c*2). Otherwise you can break up the query and use intermediate tables to do the updates. STATUSMicrosoft has confirmed this to be a problem in SQL Server 4.2 for OS/2 and Microsoft SQL Server versions 4.20, 4.21, and 4.21a. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. Additional query words: Transact-SQL
Keywords : kbprg kbbug4.20 kbbug4.21 kbbug4.21a SSrvServer SSrvWinNT |
Last Reviewed: March 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |