我的函数中有三个单独的表变量,其中 1 个没有给我任何错误,另外两个是,我没有发现它们之间有任何不同的语法,但也许我需要更多的咖啡因。
我收到的错误是
必须声明标量变量“@DispoTable”。
DECLARE @CIDdisp INT
DECLARE @DispoTable TABLE
(
CaseID INT,
Code INT,
Description VARCHAR(150)
)
--Gather Data From filter
SELECT @CIDdisp = CaseID, @Code = Code, @Description = Description
FROM fnRecidFilter3(@CaseID,01,01)
-- Insert into Temp table
INSERT INTO @DispoTable (CaseID, Code, Description)
VALUES (@CIDdisp, @Code, @Description)
-- Merge the Temp Table with RecidReport Table
INSERT INTO RecidReport(Code, Description)
SELECT Code, Description
FROM @DispoTable
WHERE (@DispoTable.CaseID) = CaseID
有什么我想念的吗?