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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Update Question
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

20 Posts

Posted - 06/16/2006 :  09:42:17  Show Profile  Reply with Quote
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?


In (Som, Ni, Yak)

17689 Posts

Posted - 06/16/2006 :  09:48:36  Show Profile  Reply with Quote
No. You can't update multiple table in a single statement.


Go to Top of Page

Flowing Fount of Yak Knowledge

United Kingdom
1074 Posts

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

Ryan Randall London-based IT consultancy

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

Starting Member

20 Posts

Posted - 06/16/2006 :  10:11:23  Show Profile  Reply with Quote
Thanks guys...I had a feeling that it wasn't going to be as easy as it sounded.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000