Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Transfer data from one database to another without identities but keep the relation b/w PK and Foreign key

$
0
0

Hi,

I need to transfer data from one database to another database (both are identical databases). 

1. Not transferring identity columns (primary keys). the destination table might have the same key.

2. keep the PK's and FK's relation b/w parent and child table

3. I have 4 levels 

Example: tableA (col1 int identity(1,1) , col2, col3)

tableB (col1 int identity(1,1) , col2 , col3) -- col2 has the foreign key relation with tableA.col1

tableC (col1 int identity(1,1) , col2, col3) -- col2  has the foreign key relation with tableB.col1

tableD (col1 int identity(1,1) , col2, col3) -- col2  has the foreign key relation with tableC.col1

please advise me.

Thanks in advance


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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