Use the usual syntax (see CREATE TYPE , MSDN):
(As noted in the comments on my answer, the correct normal syntax would be to use named constraints, but table types cannot use the named constraint and must use the "abbreviated" syntax).
CREATE TYPE [dbo].[MyDefineType] As Table ( ID int NOT NULL DEFAULT 0 , Column1 int NOT NULL DEFAULT 99 , Column2 Nvarchar(128) NULL DEFAULT N'DefaultValue' , Column3 Nvarchar(128) NULL , Column4 Nvarchar(128) NULL , Column5 Nvarchar(128) NULL )
For example, using the above definition with default values in the first three columns:
DECLARE @t MyDefineType INSERT @t VALUES (1, DEFAULT, DEFAULT, N'c', N'd', N'e') SELECT * FROM @t ID Column1 Column2 Column3 Column4 Column5 1 99 DefaultValue cde
source share