如何获取存储过程结果集值 [英] How to get the stored procedure result set value

查看:39
本文介绍了如何获取存储过程结果集值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个存储过程 A,它调用另一个过程 B,它返回结果集的列表.

I create a stored proc A that calls another proc B, which returns a list of the result set.

如何在我的 proc A 中使用这些结果集值,因为我必须将这个结果集值一个一个地传递给 proc A 的其他部分.

How I can use these result set values in my proc A as I have to use this result set value one by one to pass to other part of the proc A.

推荐答案

您可以执行 INSERT INTO 将存储过程的结果插入到(临时)表中.然后,您可以使用 select 语句来处理这些结果.

You can perform an INSERT INTO to insert the results of the stored procedure into a (temporary) table. You can then use a select statement to process these results.

INSERT INTO SomeTableThatMatchesTheSproc
EXEC YourStoredProcedure;

SELECT * FROM YourTable;

这篇关于如何获取存储过程结果集值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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