把存储过程得到的结果集插入到临时表中
create proc p_1
as
select * from branch
go
select * into #1 from branch where 1=2
insert #1
exec('p_1')
select * from #1
本文介绍了一种使用存储过程将结果集插入到临时表的方法。通过创建存储过程并执行特定的SQL语句,可以实现从现有表中选择数据并将其存入临时表的功能。
把存储过程得到的结果集插入到临时表中
create proc p_1
as
select * from branch
go
select * into #1 from branch where 1=2
insert #1
exec('p_1')
select * from #1

被折叠的 条评论
为什么被折叠?