SSIS - Iterate through SQL Scripts and pass resultset to delimited file

venkatesh padmanabhan 181 Reputation points
2020-10-26T11:41:14.79+00:00

Hi.
I am using SSIS. I have 40 odd SQL Queries, which need to be executed and each of the resultset of the query moved to a delimited file. How to achieve this with performance as a criteria . what is the option to use in SSIS ?

Thanks

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalv-MSFT 5,926 Reputation points
    2020-10-27T03:39:54.193+00:00

    Hi @venkatesh padmanabhan ,

    1.We can store the sql queries in the sql table.

    2.We use Execute SQL Task to get the SqlQuery column. Then store the sql queries in the object variable.

    3.We can use Foreach Loop Container to read each sql query that stored in the object variable. Then store the sql query in the string variable.

    4.We can set DataAccessMode as SQL command from variable in the OLEDB source editor.

    5.We can add a Flat File Destination.

    35345-dataaccessmode.png

    Hope the following link will be helpful:

    Using SSIS packages to add row headers and data into flat files

    Best Regards,
    Mona


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.