I have two databases with each one on a different server. I can copy
both databases to the same server with no problems. But how do I merge
them?
This is what I came up with so far but how do I do the same process for
multiple rows and tables?
IF NOT EXISTS (SELECT tmp_DB1.dbo.tb1.key1 FROM tmpDB1.dbo.tb1 WHERE
tmp_DB1.dbo.tb1.key1 = tmp_DB2.dbo.tb1.key1)
INSERT INTO tmp_DB1.dbo.tb1 (<all fields>)
VALUES (<all fields>)
Thanks in advance.