I am interested in the T-SQL source code for synchronizing a table (or, possibly, a subset of it) with data from another similar table. Two tables can contain any variables, for example, I could have
base table source table
========== ============
id val id val
---------- ------------
0 1 0 3
1 2 1 2
2 3 3 4
or
base table source table
=================== ==================
key val1 val2 key val1 val2
------------------- ------------------
A 1 0 A 1 1
B 2 1 C 2 2
C 3 3 E 4 0
or any two tables containing similar columns with similar names. I would like to be able
- check that the two tables have matching columns: the source table has exactly the same columns as the base table, and the data types correspond
- make diff from base table to source table
- make the necessary updates, delete and paste to modify the data in the base table to match the original table
- optionally restricts diff to a subset of the base table,
. - ?