SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


IS it possible to have dynamic sql in ole db src where the table is the part that is dynamic?


IS it possible to have dynamic sql in ole db src where the table is the part that is dynamic?

Author
Message
dndaughtery
dndaughtery
SSC Eights!
SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)

Group: General Forum Members
Points: 874 Visits: 1086
I am trying to create a for each loop and inside the loop add a dataflow where I pass in a variable with a dynamic query where the only part that changes on iteration of the loop is the table name. I'm doing this because I have 50 databases with 700 tables in each that need to be migrated to another database. I'm begining to think that it may not be possible because the metadata will change on each iteration.


I have it set up to use a Transfer SQL Server Objects task and it works but I dont like the idea of not having any error handling with the task. Is there a way to catch the error and use an exe sql task to insert the name of the table to a log table that caused the error with an Transfer SQL Server Objects task ?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27315 Visits: 13268
No. SSIS can't handle the changing metadata.

Maybe using the Import/Export wizard can be an option?


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

MCSE Business Intelligence - Microsoft Data Platform MVP
CozyRoc
CozyRoc
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2376 Visits: 2235
As Koen have stated this is not possible with the standard SSIS, which only supports static metadata. This means you have to create separate data flow for each table you want to process.

If you can use third-party components, check the commercial COZYROC Data Flow Task Plus. It is an extension of the standard Data Flow Task and it supports dynamic columns at runtime. You can process all your tables with only one For Each Loop (FEL) container and one COZYROC Data Flow Task Plus. No programming skills are required.

---
SSIS Tasks Components Scripts Services | http://www.cozyroc.com/


dndaughtery
dndaughtery
SSC Eights!
SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)

Group: General Forum Members
Points: 874 Visits: 1086
Nice! I will see if we can use 3rd party
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