SSIS set variable at runtime

2019-02-21 08:04发布

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

3条回答
Lonely孤独者°
2楼-- · 2019-02-21 08:35

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

For a video tutorial, the video below helps. http://www.youtube.com/watch?v=qZEannKhY5o

查看更多
Animai°情兽
3楼-- · 2019-02-21 08:40

Lots of ways really, but the one I use most frequently is to use an execute SQL task and set the result set to single row and then put the results set into the variable.

查看更多
等我变得足够好
4楼-- · 2019-02-21 08:56

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

查看更多
登录 后发表回答