Loading...


Actually, When we create a column with default value, SQL server creates a default constraint for that default value.

Create table Test (col1 int default(1))

Now, If we check this table then we will find a constraint is created with respect of col1 column. 
like:- DF___test__col1__5A3B20F9 

If we want to modify default value for existing column, we have to drop constraint of this column col1 first.

alter table Test drop constraint DF___test__col1__5A3B20F9

And then we can create a new default constraint

alter table _temp add constraint DF_test_col1_5A9B50C9 default 1 for col1

Thus, we can modify existing default value of a column.