User Defined Table Type (UDT) code example
Example: create user defined table type in sql
CREATE TYPE UT_Employee AS TABLE
(
Emp_Id int NOT NULL,
EmployeeName nvarchar(MAX),
EmpSalary varchar(50),
StateId varchar(50),
CityId varchar(50)
);
CREATE PROCEDURE USP_Insert_Employee_Infi(@Employee_Details [UT_Employee])
AS
BEGIN
INSERT INTO dbo.Employee
(
Emp_Id,
EmployeeName,
EmpSalary,
StateId,
CityId
)
SELECT * FROM @Employee_Details
END;