Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


50+ tables need to be copied using Data Flow task.


50+ tables need to be copied using Data Flow task.

Author
Message
dfine
dfine
SSChasing Mays
SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)

Group: General Forum Members
Points: 621 Visits: 597
Hi,
I need to move data from one server to another server, there are 50+ tables to be copied.
For this, I am creating a SSIS package; however creating Data Flow task for each table is going to be a massive work. Is there any easy way or workaround?

Source and destination database is in SQL Server 2008.

Thanks for your comments.

Raj
s_osborne2
s_osborne2
Right there with Babe
Right there with Babe (745 reputation)Right there with Babe (745 reputation)Right there with Babe (745 reputation)Right there with Babe (745 reputation)Right there with Babe (745 reputation)Right there with Babe (745 reputation)Right there with Babe (745 reputation)Right there with Babe (745 reputation)

Group: General Forum Members
Points: 745 Visits: 2292
So you need to copy 50+ tables....

1) Do you need to do this once, and once only, or is this going to become a regular thing?
2) How many tables are there in the database in total?

Thanks


Simon



MCSE: Data Platform
MCSE: Business Intelligence
Follow me on Twitter: @WazzTheBadger
LinkedIn Profile: Simon Osborne
HanShi
HanShi
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3051 Visits: 3633
Perhaps you can use the import/export wizard to create an initial SSIS package. Save this package in the last step of the wizard instead of executing it. Modify the saved package to your needs by adding/changing steps and tasks.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Daniel Bowlin
Daniel Bowlin
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2954 Visits: 2629
Skip the data flow. Create a for each loop based on an enumeration of source tables. Inside the for each loop put a Execute SQL Task with your SQL built using a varialble with an expression using the table name enumerated from the source to define your source and target.
aaron.reese
aaron.reese
Mr or Mrs. 500
Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)Mr or Mrs. 500 (591 reputation)

Group: General Forum Members
Points: 591 Visits: 898
I am guessing that becuase the source data structure is different for each table you can't just dynamically assign the ole data source because the metadata will be different for each run.

As already suggested, is this a one off excercise or are you going to need to repeat it.

can you make the two servers linked, if so then your best bet may be to generate a dynamic SQL statement which gets the field details from the sys.columns and you just pass the tablename through to the stored procedure, in which case SSIS is probably overkill and you might as well do it directly insite SMMS as a script
dfine
dfine
SSChasing Mays
SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)SSChasing Mays (621 reputation)

Group: General Forum Members
Points: 621 Visits: 597
Yes, this is one time exercise. I planned to go with SSIS package because as per the company policy I should not use linked server approach. There are 129 tables but I am only interested in 70 tables.

Raj
HanShi
HanShi
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3051 Visits: 3633
If the destination database is created upon running your transfer, then there is another possibility. You can create a backup of the complete source database and restore this as the target. After the restore you can remove the 59 tables you don't need, leaving the 70 tables you want.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Koen Verbeeck
Koen Verbeeck
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16544 Visits: 13210
dfine (7/5/2013)
Yes, this is one time exercise. I planned to go with SSIS package because as per the company policy I should not use linked server approach. There are 129 tables but I am only interested in 70 tables.


Just use the import/export wizard, this will be the fastest.
When the SSIS package is created for you, remove all precedence constraints to force the package to run in parallel.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search