dbTalk Databases Forums  

SSIS newbie

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


Discuss SSIS newbie in the microsoft.public.sqlserver.dts forum.



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

Default SSIS newbie - 12-06-2009 , 10:15 PM






Hello,

I have been able to create SSIS packages for my Access 2003 table migration
to SQL 2005. After attempting to import the tables with Foreign key errors &
constraint errors I learned thru going thru some of these community threads
that you need to delete or disable the relationships & the Identity seeds
that I created in the SQL table PRIOR to any successful migration.

After thinking that I would only migrate once I figured, whate the heck - I
keep good notes & I can recreate them after the migration. Well, I did that
only to discover that I will need to migrate atleast 2 more times.

Can you assist me in perhaps working around this without deleting these
relationships & iIdentities - I believe I read something about making a
script to temporarily DISABLE these relationships, etc. MAKE the migration &
then ENABLE the relationships to be put in place again.

I hope this made sense - any input is appreciated.

thanks,
James

Reply With Quote
  #2  
Old   
Todd C
 
Posts: n/a

Default RE: SSIS newbie - 12-07-2009 , 08:02 AM






Hello James and welcome to the SSIS(DTS) forums.

You're in luck. You can do everything you need right from within SSIS!

Since you are using SQL 2005, take these steps:
*Open your database in SQL Server Management Studio, and drill down the
nodes until you get to one of the tables in question.
*Expand the Keys node. Right-click on one of the keys and select "Script Key
as" >> "Drop and Create to" >> "New Query Editor window
*Open the SSIS Project/Package that loads this table.
*Create two Execute SQL Tasks on the Control Flow.
*Copy the "ALTER TABLE ... DROP CONSTRAINT ... " portion to one of the SQL
Tasks, and the "ADD CONSTRAINT" portion to another.

Now simply get them to execute in the correct order on either side of the
data flow component.

Note that you may need to run some of the ADD CONSTRAINT statements after
other tables have been loaded. A good practice would be to drop all the keys
first, then truncate all the tables, then load the data, then re-create the
keys.

You can also pack ALL the like statements into one task for simplicity.

HTH
=====
Todd C


"James Scho" wrote:

Quote:
Hello,

I have been able to create SSIS packages for my Access 2003 table migration
to SQL 2005. After attempting to import the tables with Foreign key errors &
constraint errors I learned thru going thru some of these community threads
that you need to delete or disable the relationships & the Identity seeds
that I created in the SQL table PRIOR to any successful migration.

After thinking that I would only migrate once I figured, whate the heck - I
keep good notes & I can recreate them after the migration. Well, I did that
only to discover that I will need to migrate atleast 2 more times.

Can you assist me in perhaps working around this without deleting these
relationships & iIdentities - I believe I read something about making a
script to temporarily DISABLE these relationships, etc. MAKE the migration &
then ENABLE the relationships to be put in place again.

I hope this made sense - any input is appreciated.

thanks,
James

Reply With Quote
  #3  
Old   
James Scho
 
Posts: n/a

Default RE: SSIS newbie - 12-07-2009 , 10:29 PM



Thank you very much Todd - I will go ahead & try to implement - thanks for
your quick response!
best regards,
James

"Todd C" wrote:

Quote:
Hello James and welcome to the SSIS(DTS) forums.

You're in luck. You can do everything you need right from within SSIS!

Since you are using SQL 2005, take these steps:
*Open your database in SQL Server Management Studio, and drill down the
nodes until you get to one of the tables in question.
*Expand the Keys node. Right-click on one of the keys and select "Script Key
as" >> "Drop and Create to" >> "New Query Editor window
*Open the SSIS Project/Package that loads this table.
*Create two Execute SQL Tasks on the Control Flow.
*Copy the "ALTER TABLE ... DROP CONSTRAINT ... " portion to one of the SQL
Tasks, and the "ADD CONSTRAINT" portion to another.

Now simply get them to execute in the correct order on either side of the
data flow component.

Note that you may need to run some of the ADD CONSTRAINT statements after
other tables have been loaded. A good practice would be to drop all the keys
first, then truncate all the tables, then load the data, then re-create the
keys.

You can also pack ALL the like statements into one task for simplicity.

HTH
=====
Todd C


"James Scho" wrote:

Hello,

I have been able to create SSIS packages for my Access 2003 table migration
to SQL 2005. After attempting to import the tables with Foreign key errors &
constraint errors I learned thru going thru some of these community threads
that you need to delete or disable the relationships & the Identity seeds
that I created in the SQL table PRIOR to any successful migration.

After thinking that I would only migrate once I figured, whate the heck - I
keep good notes & I can recreate them after the migration. Well, I did that
only to discover that I will need to migrate atleast 2 more times.

Can you assist me in perhaps working around this without deleting these
relationships & iIdentities - I believe I read something about making a
script to temporarily DISABLE these relationships, etc. MAKE the migration &
then ENABLE the relationships to be put in place again.

I hope this made sense - any input is appreciated.

thanks,
James

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.