SQL Server Forums
Profile | Register | 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
 New Topic  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)

17684 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
www.monsoonmalabar.com 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  
 New 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.05 seconds. Powered By: Snitz Forums 2000