The Default object represents the attributes of a single Microsoft® SQL Server™ default. SQL Server defaults provide data to columns and user-defined data types when no other data is available on an INSERT statement execution.
SQL Server defaults allow a nonredundant method of default-value specification. SQL Server columns can contain a DEFAULT constraint, but each column receiving a specific default value must be constrained to receive it. Alternately, a single default can be created and then bound to columns or user-defined data types, allowing the developer to specify the default value one time.
With the Default object, you can:
The Name property of a Default object uses the SQL Server data type sysname. The value of the Name property must be unique within a SQL Server database when constrained by the value of the Owner property.
To create a SQL Server default
After the SQL Server default has been created, use the BindToColumn and BindToDatatype methods of the Default object to bind the SQL Server default to SQL Server columns and user-defined data types.
BindToColumn Method | Remove Method (Objects) |
BindToDatatype Method | Script Method |
ListBoundColumns Method | UnbindFromColumn Method |
ListBoundDatatypes Method | UnbindFromDatatype Method |
CreateDate Property | Owner Property (Database Objects) |
ID Property | Text Property |
Name Property |