UDTs have following restrictions -
CREATE TYPE dbo.Ids as TABLE
(
Id int PRIMARY KEY
)
CREATE TYPE MyComplexType as TABLE
(
Id int,
Name varchar(10)
)
CREATE TYPE MyUniqueNamesType as TABLE
(
FirstName varchar(10),
LastName varchar(10),
UNIQUE (FirstName,LastName)
)
Note: constraints in user defined table types can not be named.
CREATE TYPE MyUniqueNamesType as TABLE
(
FirstName varchar(10),
LastName varchar(10),
CreateDate datetime default GETDATE()
PRIMARY KEY (FirstName,LastName)
)