question

fahadsalam avatar image
fahadsalam asked

SSIS to import data to SQL Server 2005 from another SQL Server 2005 Database

Hi all, I am have created a new empty SQL Server 2005 DB using script from an existing SQL Server 2005 DB with tables having foreign key relationships. I need to transfer data from the master tables of the old DB to the new DB. When I use the Import/Export Wizard the task fails because of the foreign key issue. I want the transfer of the data from selected tables in a sequential order so that the foreign key constraints are met. I would like to know the easiest way to do this considering the fact that I have got numerous tables to deal with. Any help is much appreciated.
ssis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ThomasRushton avatar image
ThomasRushton answered
Easiest way? Drop the FK relationships, move the data, recreate the FKs. Or restore the new database from a backup of the old, and remove the data you don't want. There's probably something in SSIS that'll do the job too.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·
Oh wait. My bad. You're already in SSIS. Sorry.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.