1、知道返回集的结构,这很简单
create table #t (...)
insert #t(...) exec proc_1 参数
2、关键是不知道返回集的结构,用远程调用
select * into #t from OPENROWSET(
‘SQLOLEDB‘,
‘SERVER=server;uid=sa;pwd=123;Database=test‘,‘SET FMTONLY OFF;set nocount on;
exec sp_1 ‘‘a‘‘‘) as a
select * from #z
drop table #z
联系客服