将存储过程中返回的结果集在另一个存储过程中保存到临时表
整理一下,记录以便以后查阅。我在SQL SERVER 2005 EXPRESS测试没问题。
来源:http://www.itpub.net/thread-1438927-1-1.html
其他参考链接:http://www.cnblogs.com/footleg/archive/2008/09/09/1287327.html
用 OPENROWSET来做
sp_configure 'Show Advanced Options', 1
GO
RECONFIGURE
GO
sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
go
SELECT *
INTO MyTable --( can be either a temp table or perm table,不用事先知道其Schema,这正是你想要的)
FROM OPENROWSET('SQLNCLI', 'server=.;trusted_connection=yes',
'exec AdventureWorks.dbo.uspGetEmployeeManagers 17')
浙公网安备 33010602011771号