Updating a table column

  • 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

  • UPDATE updatetble1 SET updatecol1 = sourcecol2 FROM updatetble1  JOIN sourcetbl2 ON updatetble1.rowid = sourcetbl2.rowid

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • UPDATE updatetble1

    SET updatetble1.updatecol1 = updatetble2.updatecol2

    FROM updatetble1 INNER JOIN updatetble2

    ON updatetble1.joiningcolumn = updatetble2.joiningcolumn

    WHERE Yourcondition = Your Value

  • 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