create User Defined Type table

Posted by Professionaluser under Sql Server category on | Points: 40 | Views : 833
To create user defined type (UDT) in SQL server, use below code...

Sample code is,

IF EXISTS (SELECT * FROM sys.types WHERE name = N'udtTblContentID' )
DROP TYPE [dbo].[udtTblContentID]

CREATE TYPE [dbo].[udtTblStudentID] AS TABLE (
[StudentID] [bigint] NULL

We can use the above created UDT as a data type to pass a table/resultset as input to any of the stored procedure/functions in SQL Server

Comments or Responses

Login to post response