INFO: Aggregates and SET Clause in UPDATE Statement (90477)
The information in this article applies to:
- Microsoft SQL Server 4.2x
- Microsoft SQL Server 6.0
- Microsoft SQL Server 6.5
- Microsoft SQL Server 7.0
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q90477 SUMMARY
In an UPDATE statement, an aggregate function cannot appear directly
in the SET list. For example, an attempt to execute a query such as,
UPDATE <table name>
SET <column name> = count(*)
FROM <table names>
WHERE <condition List>
generates the following message in 4.2:
An aggregate may not appear in the set list of an UPDATE statement.
(Msg 157, Level 15, State 1).
Modification Type: | Minor | Last Reviewed: | 2/14/2005 |
---|
Keywords: | kberrmsg kbinfo KB90477 |
---|
|