将返回多个数据集的存储过程中的数据插入到 SQL Server 2008 中的临时表中
我的存储过程返回多个结果集。
我想要从存储过程中获取第二个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在 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