SSIS - Script + Process task to pass values to Par

2019-07-25 07:40发布

问题:

I have an SSIS Package that has a process task to be executed which internally executes a *.bat file.

The *.bat file has a few steps that are executed.I want to feed in some of the values in the batch file as parameters %1,%2 etc

I have the structure like the following:

-username %1 -p%2

I want to pass values dynamically to this process task using a script task that would be present before the process task.

Please let know how this can be achieved

回答1:

Execute Process Task has Arguments property, which can be set dynamically via Expressions.

  1. Store parameters values in variables, e.g. Param1 and Param2
  2. Select Expressions property of Execute Process Task and create new expression: Property = Arguments and Expression similar to "-username " + @[User::Param1] + " -p" + @[User::Param2]. If params aren't strings you should cast them to strings.