BUG: Update Syntax Allows Ambiguous Tablenames/AliasesID: Q151113
|
In an update statement, if you specify a particular table/alias name for the table to be updated, and specify a different tablename/alias as a prefix to the column(s) to be updated, no errors are generated.
No workaround is required. The only table that will be updated is the table that you specify with the UPDATE, irrespective of any aliases that you use in the SET clause.
Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
The following script demonstrates this problem.
create table t1 (x int)
go
/* Example 1 */
update t1 set arbitrary.x = 10
go
/* Example 2 -> ONLY FOR SQL SERVER 6.5 */
update a set b.x = 10 from t1 a, t1 b
go
Keywords : kbprg kbusage SSrvProg kbbug6.50 kbbug6.00
Version : 6.0 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: March 26, 1999