Trying to create a stored procedure like this:
CREATE PROCEDURE Students
@List StudentList READONLY,
@AdmissionId VARCHAR(max)
AS
BEGIN
INSERT INTO RcordsTable (StudentId, RollNumber, AdmissionId)
VALUES(@List.StudentId, @List.RollNumber, @AdmissionId)
END
Where List
is type valued table which is already created in the database with 3 columns StudentList
, RollNumber
and Id
.
When I try to create this procedure in SQL Server 2008, I am getting following error:
Must declare the scalar variable @List