如何根据存储过程输出停止包执行? [英] How can I stop a package execution based on a stored procedure output?

查看:22
本文介绍了如何根据存储过程输出停止包执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SSIS 包,第一个任务执行一个存储过程来验证运行日期不是假期.如果是假日,则返回一个计数为 1 的记录集.

I have an SSIS package that the first task executes a stored procedure to verify that the run date is not a holiday. If it is a holiday, then it returns a record set with a count of 1.

如果记录计数为 1,我希望能够停止 SSIS,但如果记录计数为零则继续运行.我不知道实现这一点的最佳方法.我应该向包中添加什么控制流项?

I want to be able to stop the SSIS if the recordcount is 1 but continue to run if the recordcount is zero. I don't know the best way to implement this. What control flow item should I add to the package?

我对 SSIS 比较陌生,所以我不知道要添加什么项目.任何帮助都会很棒.

I am relatively new to SSIS so I don't know what item to add. Any help would be great.

推荐答案

嗯,一种方法是创建一个 Execute SQl 任务来使用它来设置变量 @Holiday 的值.然后通过右键单击绿线本身并单击编辑,将 Execute SQl 任务的成功流程线更改为成功和约束.选择表达式和约束作为计算操作,然后为表达式添加如下所示的表达式:

Well one way is to create an Execute SQl task to use that you use to set the value of variable @Holiday. Then change the Success flow line coming out that Execute SQl task to both success and a constraint by right clicking on the green line itself and clicking edit. Choose Expression and Constraint as the evaluation operation and then add an expression something like the below for the expression:

@Holiday == 0

这篇关于如何根据存储过程输出停止包执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆