I have 2 tables with same schema on 2 different databases on the same server with SQL Server 2008 R2.
One table gets updated with data more often.
Now there is a need to keep these 2 table in sync. This can happen as a nightly process.
What is the best methodology to achieve the sync. process ?
Using MERGE is your best bet. You can control each of the conditions. WHEN MATCHED THEN, WHEN UNMATCHED THEN etc.
MERGE – Technet
MERGE- MSDN (GOOD!)
Example A: Transactional usage – Table Variables – NO
Example B: Transactional usage – Physical Tables
Example C: Transactional usage – Tempdb (local & global)