Gallop
Gallop

Reputation: 1405

SSIS - Script + Process task to pass values to Parameters

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.

enter image description here

Please let know how this can be achieved

Upvotes: 1

Views: 7616

Answers (1)

Piotr Sobiegraj
Piotr Sobiegraj

Reputation: 1783

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.

Upvotes: 4

Related Questions