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

  • 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 ?

  • No. SSIS can't handle the changing metadata.

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

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • 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/

  • Nice! I will see if we can use 3rd party

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply