执行SQL任务+存储过程+总行数 [英] Execute SQL Task + stored procedure + total count of rows

查看:123
本文介绍了执行SQL任务+存储过程+总行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数据流任务,我通过'执行SQL任务'执行存储过程来获取传递给条件分割任务的结果集(行)管道行以生成不同的csv文件。如果有
没有数据,用户要求不生成csv文件。 

I have dataflow task in which I execute stored procedure via 'Execute SQL task' to get result set (rows) which are passed to conditional split task which pipes rows to generate different csv files. user requirement is not to generate csv files if there is no data. 

为了做到这一点,我需要检查是否返回了哪些行我不能做数据流任务。我需要在控制流中运行相同的执行SQL任务并将计数放入变量并在流箭头中检查该变量。

In order to do it, I need to check if rows are returned which I can't do in dataflow task. I need to run same Execute SQL task in Control Flow and put the count in a variable and check that variable in flow arrows.

如何使用相同的存储过程返回计数和结果集。

How can I have same stored procedure return count and result set.

还有其他办法来处理这种情况吗?

Is there any other way to handle this kind of scenarion?

谢谢

推荐答案

您好SPunny,

Hi SPunny,

这是可能的。

您的SP可以利用 OUTPUT 变量类型和结果集。

Your SP can leverage OUTPUT type of variable as well as a result set.


这篇关于执行SQL任务+存储过程+总行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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