Let say you have a User Defined Type that follows:
CREATE TYPE [dbo].[MyDefineType] As Table
(
ID int NOT NULL
, Column1 int NOT NULL
, Column2 Nvarchar(128) NULL
, Column3 Nvarchar(128) NULL
, Column4 Nvarchar(128) NULL
, Column5 Nvarchar(128) NULL
)
So when I passed a valued table through a stored procedure, the type mirrors the schema of the table.
My question is what is the syntax to give one of the columns a defualt value? For example, if I passed the these values through a stored procedure in a loop, I could give column 5 a default value, so if I passed values for only the first 4 columns, 5 would defalut to what I defined it to be if no value was passed. Is that possible with a user defined type?
[name] [data type] DEFAULT N'value'- Aaron Bertrand