January 23, 2006 at 11:42 am
Hi All,
I'm trying to update the content of a table column (updatetble1, updatecol1) with the contents of another table column (sourcetbl2, sourcecol2). I have column in each table with identicle information that I can use to link the 2 tables but I'm not sure how to copy the contents of one column into the other. Do I have to use a declare statement or some type of join or what?
Thanks for your help, Meredith
January 23, 2006 at 11:59 am
UPDATE updatetble1 SET updatecol1 = sourcecol2 FROM updatetble1 JOIN sourcetbl2 ON updatetble1.rowid = sourcetbl2.rowid
January 23, 2006 at 12:00 pm
UPDATE updatetble1
SET updatetble1.updatecol1 = updatetble2.updatecol2
FROM updatetble1 INNER JOIN updatetble2
ON updatetble1.joiningcolumn = updatetble2.joiningcolumn
WHERE Yourcondition = Your Value
January 23, 2006 at 12:54 pm
David's SQL worked for me
Thanks David
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply