update table A with Table B''s table.status value

  • I have 2 tables, trying to update and replace the status in one with the other based on master.number match

    UPDATE master m

    set m.status = (SELECT status from masterbackup where number = m.number )

    FROM mastermasterbackup

  • UPDATE m

    set status = mb.status

    FROM master m

         join mastermasterbackup mb

          on m.number = mb.number

     


    * Noel

  • you also could use a trigger to do that


    Daniela

  • right on...thanks!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply