Click here to monitor SSC
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-Addicted
SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)

Group: General Forum Members
Points: 456 Visits: 1071
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
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: 16467 Visits: 13207
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?

Member of LinkedIn. My blog at SQLKover.

MCSA SQL Server 2012 - MCSE Business Intelligence
CozyRoc
CozyRoc
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1150 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-Addicted
SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)SSC-Addicted (456 reputation)

Group: General Forum Members
Points: 456 Visits: 1071
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