1

I have to extract a table from SQL Server to Excel on a weekly basis.

For this purpose I am required to include a specific ID for that week in the file name.

I have created my variable, and have created a stored procedure which returns a single value every time related to the specific week we are in.

However I am unsure how I can assign that value to the variable.

Any chance anyone can help me out?

p.s. I apologize in advance if this was already answered somewhere else, Google did not help me that much.

1 Answer 1

2

1. You can use the OUTPUT parameter :

When you're using the Execute SQL Task within SSIS. You must specify that the parameter is on OUTPUT and also specify it in the Parameter mappings tab.

enter image description here

Create the variable YourVariable in your package having the type String and map it to the result like below:

enter image description here

  1. You can achieve the same result using Single Result Set : It's similar to the first step of the previous solution, except that you need to set ResultSet to SingleRow :

enter image description here

Then, on the Result Set tab, map the first column to the variable created in the package YourVariable : enter image description here

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

1 Comment

Awesome my friend, many thanks for the detailed walk through :)

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.