For suppose we have a UDT named as StudentType with columns StudID, StudName and StudFee
CREATE TYPE dbo.StudentType AS TABLE
(
[StudID] [int] ,
[StudName] [varchar](30) ,
[StudFee] [int]
)
How do we pass the above UDT as input to SP?
CREATE PROCEDURE dbo.usp_StudentDetails
@StudentDetail dbo.StudentType READONLY
AS
BEGIN
SET NOCOUNT ON
INSERT INTO dbo.[Student] ([StudentID], [StudentName], [StudentFee])
SELECT [StudID], [StudName], [StudFee] FROM @StudentDetail
END