Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

SQL Server - Merging Two Tables with PK on both tables

$
0
0

Hi,

I had a situation where we have two different DBs with Table-A (on DB1) & Table-B (on DB2). I have to merge both tables to a single new table (Table-C, this table can be on DB1 or DB2 or NewDB). 

Here Table-A & Table-B are PK enabled & need the same on Table-C. Just want to know few suggestions/approaches on how to handle PK conflicts while merging data from both tables.

Brief questions:
1) Approaches/suggestions to merge these tables.
2) Approaches/suggestions to handle PK conflicted records during this merge process.

Kindly provide detailed explanation in doing this.

Thanks,


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>