0

I have a execute SQL task, that needs two input variables and a output variable to run. The SP returns a table that i'm storing in ResultSet parameter. I want to store the values in this ResultSet parameter in a excel file. From my internet research(similar SO question, Export data from SQL Server to Excel), i found a few articles where they create a ADO.NET sources. Run a simple select query inside it and use excel destination. In my case, the parameters to SP have to be passed as variable.Hence, i can't use the harcoded SQL queries. Can anyone please point me in the current direction? My knowledge of SSIS is very limited to be doing a good google search.

2
  • 2
    The easiest way to do this is in a data flow. Use a SQL Server source (you can use a question mark (?) as a placeholder to map variables) and an excel destination (although I would recommend csv). example select * from table where column = ?, Parameters are set in order of appearance in the sql Commented May 19, 2021 at 16:48
  • 1
    @KeithL would it work for Exec [StoredprocedureName] ?, ? ? OUTPUT as well. Also, do you have any link to help me with this?code Commented May 19, 2021 at 17:22

1 Answer 1

1

If the question is, how to store values from ResultSet parameter to Excel, you have to create a custom data source: https://www.timmitchell.net/post/2015/04/20/using-the-ssis-object-variable-as-a-data-flow-source/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.