Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Question 1

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
0
0
US
Can I join three tables and update fields from all?

Thanks.
 
No, you should only update one table at a time. You need to update in a specific order usually as well as the primary table should be updated first.

You can update using a join to identify which records to update, but you will still only be updating one table at a time. Something like which would update the table with the alias of cg:
Code:
Update cg
set field1 = t.field2
from table1 cg join table2 t on cg.id_field = t.id_field
where t.someotherfield = 29

Questions about posting. See faq183-874
Click here to help with Hurricane Relief
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top