我创建了以下存储过程,其返回
Create PROCEDURE GetData (@Year varchar(20),@Month varchar(20), @Workcell varchar(100))
AS
BEGIN
declare @StageName varchar(50)
declare @Amount bigint
declare @Stages table(Stage varchar(100))
create table #ResTable (Stage varchar(100),Amount bigint)
select Distinct(Stage) into #Stages from Stage_Skill_Matrix
while exists(select * from #Stages)
begin
select top 1 @StageName = Stage
from #Stages
select top 1 @Amount =Amount from Stage_Req_Master where Month=@Month and Stage=@StageName and Workcell=@Workcell
insert into #ResTable values(@StageName,@Amount)
end
select * from #ResTable
END
GO
执行此存储过程后,我期待StageName和Amount来自Temporary表ResTable,即Stages及其金额。
而是当我通过右键单击执行SP - >执行存储过程时,它不会向我显示任何内容。它只是继续执行但我可以在消息窗口中看到40row受影响但在Result窗口中没有行