1

In SSIS Package, I am executing the stored procedure usp_GetResult which returns 2 rows ( select PathName, FolderPath from config ).

PathName   : InboundFolderPath
FolderPath : c:\Inbound

PathName   : OutboundFolderPath
FolderPath : c:\Outbound

I will have to map the variables @InboundFolderPath = c:\Inbound, @OutboundFolderPath = c:\Outbound

How to map the output of the stored procedure to variable in SQL Task?

3

2 Answers 2

1

The only way I know to do this is to use "Full Result Set" in the Execute SQL Task, and store the result in an object variable.

Then use a Script Task to convert the Object Variable to a Dataset, and iterate through it to populate your scalar variables.

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

Comments

1

I haven't really tried this but how about:

Declare @T Table (pathName varchar(100), folderName varchar(100))
Insert @T Exec StoredProc params  

Select max(case when PathName = 'InboundFolderPath' then folderName end ) inBound
    ,max(case when PathName = 'OutboundFolderPath' then folderName end ) outBound
from @T

And then map

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.