将返回多个数据集的存储过程中的数据插入到 SQL Server 2008 中的临时表中

发布于 2024-12-12 12:30:42 字数 114 浏览 4 评论 0原文

我的存储过程返回多个结果集。

我想要从存储过程中获取第二个 select 语句返回的数据,并且想要将该数据插入 SQL Server 2008 中的临时表中。

知道如何实现这一点吗?

My stored procedure returns more than one result set.

I want to get the data returned by the second select statement from the stored procedure and I want to insert that data in a temporary table in SQL Server 2008.

Any idea how to implement this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腹黑女流氓 2024-12-19 12:30:42

您无法在 SQL Server 中访问多个结果集。不过有几个选项:

拆分存储过程,使其仅返回一个结果集。
使用 c#/vb/net 数据表访问第二个结果集。
创建 CLR 来访问第二个结果集。

HTHC

You can't access more than one result set in SQL Server. A couple of options though:

Split the stored procedures so only one result set it returned.
Access the second result set using c#/vb/net data tables.
Create a CLR to access the second result set.

HTH

C

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文