update sql syntax UPDATE operations covering multiple tables

1 view
Skip to first unread message

kanevd1

unread,
Nov 26, 2006, 8:23:09 AM11/26/06
to SQL Server
I need a help with SQL syntax for UPDATE operations covering multiple
tables.
I tried following index:

update table1, table2 set table1.item_descr=table2.item_descr where
table1.item=table2.item.

It did not wprk form me.

Thanks.

Dan Zeltner

unread,
Nov 26, 2006, 9:57:36 PM11/26/06
to SQL-S...@googlegroups.com
Yep, you can only update one table at a time. Split the command into two,
with one target table per update.

_________________________________________________________________
Get the latest Windows Live Messenger 8.1 Beta version. Join now.
http://ideas.live.com

Fábio Pinheiro

unread,
Nov 28, 2006, 5:34:01 AM11/28/06
to SQL-S...@googlegroups.com
update table1 set table1.item_descr = table2.item_descr
from table1, table2 where table1.item = table2.item

try this....

Dan Zeltner escreveu:

kanevd1

unread,
Dec 3, 2006, 3:09:44 PM12/3/06
to SQL Server
Thank a lot, it has worked!!

On Nov 28, 12:34 pm, Fábio Pinheiro <fcpinhe...@gmail.com> wrote:
> update table1 set table1.item_descr = table2.item_descr
> from table1, table2 where table1.item = table2.item
>
> try this....
>
> Dan Zeltner escreveu:
>
> >Yep, you can only update one table at a time. Split the command into two,
> >with one target table per update.
>

Reply all
Reply to author
Forward
0 new messages