Microsoft KB Archive/153996

= BUG: The error message provides an incorrect table name when you use an ambiguous update statement in SQL Server =

Article ID: 153996

Article Last Modified on 3/14/2005

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition
 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q153996



BUG#: 15305 (6.5) 57614 (7.0) BUG#: 224351 (SHILOH)



SYMPTOMS
Inside a trigger, if there is an ambiguous update statement and the first table in the FROM section is the logical table INSERTED or DELETED, the resulting message 8154 has an incorrect tablename. In SQL Server 7.0, the resulting message 1032 has an incorrect tablename.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.



MORE INFORMATION
The tablename in the message should actually be the table in the UPDATE section. Instead the message shows the truncated name of a different table (the one on which the trigger is being created). Since this does not happen on SQL Server versions 4.21a or 6.0, upgrades of such triggers to SQL Server 6.5 will obviously fail. The following script illustrates the problem:

drop table arbitraryname, table2 go  create table arbitraryname(x int) create table table2(x int) go  create trigger trg1 on arbitraryname for update as   begin update table2 set child.x = parent.x  from inserted, table2 child, table2 parent where inserted.x = child.x  end go

Keywords: kbbug KB153996

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.