This will work if your source and target tables are identical and have the same members (which, I believe, are primary):
UPDATE destination SET destination.col1 = source.col1, destination.col2 = source.col2, destination.col3 = source.col3, ... FROM table1 AS source JOIN table2 AS destination ON source.memberid = destination.memberid
If your source and destination tables are identical, but your source has new rows (records) that the addressee lacks, you will need a selective INSERT :
INSERT INTO table2 ( col1, col2, col3, ... ) SELECT col1, col2, col3, ... FROM table1 WHERE NOT EXISTS ( SELECT memberid FROM table2 WHERE table2.memberid = table1.memberid)
The above will only insert records that are not yet listed in your destination table. Since you are using SQL Server 2008, you can try playing with the MERGE , which should handle both situations and everything that you put into it in one set of code.
source share