I have three separate table variables in my Function,
1 of them is not giving me any errors, the other two are,
I haven’t found anything Different Syntax-wise between them, but maybe I need more caffeine.
the error I am receiving is
Must declare the scalar variable “@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
is there something that I am missing?
You can’t say:
Instead you need to use an alias:
But this clause makes no sense anyway. Did you mean to use a variable here? Perhaps:
?