this is new to me but i want to have a TVP to accept list of records as a parameter of a stored procedure. the following is the code i have written.
CREATE TABLE dbo.GroupRole
userRole VARCHAR(100) NOT NULL,
CONSTRAINT GroupRole_Pk PRIMARY KEY (userRole)
CREATE TYPE usrRoleArr AS TABLE (usrRole VARCHAR(100) PRIMARY KEY);
CREATE PROCEDURE grpRoleRecorder (@userRole usrRoleArr READONLY)
INSERT INTO dbo.GroupRole VALUES (@userRole);
when i execute the code it gives the folling error.
Msg 137, Level 16, State 1, Procedure grpRoleRecorder, Line 4
Must declare the scalar variable "@userRole".
Please help me on this.
Thank You All
View Complete Post