Adding A default constraints

A column default can be specified using default constraints. The default constraint is used to insert a default value into a column. The default value will be added to all new record, if no other values is specified, including null.


Altering an existing column to add a default constraint

Syntax:-

Alter table table_name add constraint (constraints_name) default  (default_value) for (existing column name)

Query:-

Alter table tblemployee add constraint df_tblgender_gnderid default 3 for genderId


NOTE 

Tblemployee  = table name

Df_tblgender_gnderid = default constraint 

3= Default value