首页 > 解决方案 > SSIS: Go back to prior step when If-condition is not met

问题描述

I build a workflow in SSIS. At two steps this workflow is checking an If-Condition.

If the result is true, the workflow should continue.

If it is false the workflow should go back to prior step and start over.

It is clear to me how to implement the If-Condition. But how can I redirect the control flow to a prior step? If I just link one node to the prior node I am getting following error. enter image description here

Is there any special node for this issue? Did anyone have a similar problem and knows the solution?

标签: if-statementssis

解决方案


让我在这里也为其他人添加一个示例。在此示例中,我使用控制流。该控制流程包含:

1. 两个脚本任务'Task 1'和'Task 2',目前只有一个MessageBox.Show 来显示相应的任务名称。

2. 一个表达式任务检查 if 条件。

3. 基于表达式继续的 for 循环。

4. 一个名为“Flag”的包布尔变量,最初设置为 True。

SSIS 包如下: for 循环表达式如下: 并且,表达式任务的表达式如下: 变量 Flag 可以在脚本任务 1 中针对某些特殊情况进行更改,也可以根据需要通过其他方式进行更改. 在这种情况下,循环将退出并开始运行任务 2,否则将继续任务 1。

在此处输入图像描述



在此处输入图像描述



在此处输入图像描述


推荐阅读