Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS set variable at runtime

Tags:

variables

ssis

Anyone know how I can change a SSIS variable at runtime?

I have a variable User:SkipStuff

I want to set this based on a condition during a for loop container

like image 572
Arcadian Avatar asked Oct 29 '10 14:10

Arcadian


People also ask

How do I change a variable value in SSIS?

Click a variable in the list, and then click Move Variable to change the variable scope. In the Select New Scope dialog box, select the package or a container, task, or event handler in the package, to change the variable scope. For more information about variable scope, see Integration Services (SSIS) Variables.


2 Answers

Use Expression Task instead. In the "Expressions" pane, put the variable to set on left, then equates it to the intended value.

@[User::VariableToSet] = some expressions...

Expression Builder

like image 124
Chris Voon Avatar answered Sep 22 '22 08:09

Chris Voon


You can add a Script task. Add your SSIS variable(s) to the ReadWriteVariables property in the Script Task Editor.

You can reference the variable(s) in your script using the following format: Dts.Variables["MyCaseSensitiveVariableName"].Value

like image 30
bobs Avatar answered Sep 24 '22 08:09

bobs