【发布时间】:2018-11-09 14:21:36
【问题描述】:
我正在尝试调试填充#table 的存储过程(比如说proc1),比如说#reserves。该过程没有针对#reserves 的插入语句,但仍有一些数据被填充到表中,这些数据作为结果集发送到输出。
Proc1 在内部调用 Proc2,它也声明了 #reserves 并填充了一些数据。我的问题是 - Proc2.#reserves 有没有办法将数据发送到 Proc1.#reserves?
以下是示例程序
Create Proc1
As
Begin
Create Table #Reserves
(
id int not null,
value int not null
)
Exec Proc2
Select id,
value
from #Reserves
End
Create Proc2
AS
Begin
Create Table #Reserves
(
id int not null,
value int not null
)
Insert into #reserves
(id, value)
Select 1 as id,2 as value
End
【问题讨论】: