dbTalk Databases Forums  

SSIS package to export linked tables

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS package to export linked tables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nigel
 
Posts: n/a

Default SSIS package to export linked tables - 07-26-2006 , 07:52 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?


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS package to export linked tables - 07-26-2006 , 01:43 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



"Nigel" <Nigel (AT) discussions (DOT) microsoft.com> wrote

Quote:
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?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.