定义一个存储过程如下: create proc [dbo].[test1]@id intasselect 1 as id,'abc' as name union all select @id as id,'zzz' as name 返回两行数据. 现在想用SQL语句来调用这个存储过程,并把他返回的表放入变量中.可以如下做: declare @table table(id int,name varchar(50))--定义表变量来存放存储过程返回的内容insert into @table exec test1 2--将存储过程执行的结果放入表变量中select *from @table --查看表变量中的结果 相关文章: 2022-02-24 2022-01-04 2022-12-23 2022-12-23 2022-12-23 2021-08-11 2022-01-01 2021-07-19