Groups | Blog | Home
all groups > sql server dts > july 2006 >

sql server dts : SSIS package to export linked tables



Nigel
7/26/2006 5:52:02 AM
Hallo Everyone,

I have parent- child tables that I would like to transfer from one SQL 2005
database to another SQL 2005 database using SSIS. The parent table has a
primary index with a seed=1 and autoincrement=1. The Child table uses the
parent primary index as a foreign key. I have another database with a similar
structure into which I would like to insert this data. The problem is that
the primary index value will change during the export.

My Question is how can I create an SSIS package that can append the data
within these 2 linked tables into a similar parent / Child table structure on
another database?
Allan Mitchell
7/26/2006 7:43:22 PM
Well there are a number of ways to do this that I can think of.

1. Enable Identity Insert ON to do the inserts into the destination

2. Carry a column on the destination table that holds the originating ID
column value. I would then do multiple passes over the data matching to the
incoming file and the previous identity value. This lookup would retrieve
the new ney value.

There are more ways but I would try these

--


Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com



[quoted text, click to view]

AddThis Social Bookmark Button