I need to copy ref_id1 from table1 TO the column ref_id2 in the table2 the two things matching will be : id (same column name), a_ref1 & b_ref1 (column names are differe
I think this should work:
UPDATE Table2 SET ref_id2 = ref_id1 FROM Table2 JOIN Table1 ON Table2.Id = Table1.Id AND Table2.a_ref1 = Table1.b_ref1