Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Update Question

Author  Topic 

Lemmy44
Starting Member

20 Posts

Posted - 2006-06-16 : 09:42:17
I am in the process of changing ID's in multiple tables.

I am using the following code:

UPDATE table1, table2, table3....

SET table1.parent_id = cases1.case_id, table2.parent_id = cases1.case_id,
table3.parent_id = cases1.case_id....

I get an error when I try to run this. Is this format acceptable, or is there a different way to go about this?

Thanks.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-16 : 09:48:36
No. You can't update multiple table in a single statement.


KH

Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2006-06-16 : 09:49:00
Read about "UPDATE (described)" in BOL. You'll see the syntax only allows the update of one table at a time....



Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

Lemmy44
Starting Member

20 Posts

Posted - 2006-06-16 : 10:11:23
Thanks guys...I had a feeling that it wasn't going to be as easy as it sounded.
Go to Top of Page
   

- Advertisement -