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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update field based on another field in another table 1

Status
Not open for further replies.

Corr

ISP
Jan 7, 2003
48
US
Hello,

Here it goes. I have two tables: TableA and TableB. Both tables have a field named Inv_Part_Key that is the same on both tables as well as a field called Notes. The Notes field in TableA has data while TableB does not.

How can I get the data from TableA, Notes to update TableB, Notes by updating the proper rows with the proper data. I am assuming I would have to use a field that can be used as an identifier, so I included the column Inv_Part_Key.

Please let me know if more info is needed.

Thank You,

John
 
Use the UPDATE..FROM construct, like this:


UPDATE TableB
SET TableB.Notes = TableA.Notes
FROM TableA
WHERE TableB.Inv_Part_Key = TableA.Inv_Part_Key

Cheyney
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top