How to reference values between tasks in SSIS

dsk 1 Reputation point
2022-01-05T10:02:11.407+00:00

Hello,

The "Execute Process Task" calls the VBS, and the VBS returns a value.
I want to use this return value in a subsequent "Execute SQL Task" (e.g. 'exec [dbo]. [spr_hoge] @Arg_095 = [Want to set a value here]').

I think I will use ExecValueVariable, but I don't know what to do after that.
How can I achieve this?

Thanks in advance.

SQL Server Integration Services
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 41,536 Reputation points
    2022-01-06T02:55:25.133+00:00

    Hi @dsk ,

    In the Execute Process Task, create a new StandardOutputVariable named as output.

    And then use Execute SQL Task, enter the code.

    exec [dbo]. [spr_hoge] @arg =?  
    

    Go to the parameter mapping, add the output::variable.

    162688-screenshot-2022-01-06-105155.jpg

    Check this link about ssis-use-variable-in-execute-sql-task.html.

    http://kenssqlserverblog.blogspot.com/2008/10/output-results-using-execute-process.html

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


Your answer

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