Home SQL Server Commands
 

CREATE DEFAULT

A default specifies the value to be inserted into a column whenever no value is supplied.

This command will be removed in a future version of SQL Server. Avoid using this command in new development work, and plan to modify any application that currently uses it.

Syntax
      CREATE DEFAULT [schema.] default_name 
AS constant_expression [;] Key: default_name Name of the default. constant_expression An expression containing only constant values

You can create a DEFAULT definition as part of the table definition when you create a table. If a table already exists, you can add a DEFAULT definition to it. Each column in a table can contain one DEFAULT definition.

"Small is beautiful" - E. F.Schumacher

Related commands:

sp_help - List the defaults that exist
sp_unbindefault - Unbind the default from a column or an alias data type.
DROP DEFAULT

Equivalent Oracle command:

ALTER TABLE ... DEFAULT



Back to the Top

Simon Sheppard
SS64.com