Take the 2-minute tour ×

In Microsoft SQL server, how can I add/change the default on an existing table column using T-SQL?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted
ALTER TABLE yourTable ADD  CONSTRAINT constraintName  
   DEFAULT ('XYZ') FOR [YourColumn]

To change the default, drop the constraint and re-add it with the new value:

DROP CONSTRAINT constraintName

ALTER TABLE yourTable ADD  CONSTRAINT constraintName  
   DEFAULT ('ABC') FOR [YourColumn]
share|improve this answer
Can also do it in the designer. –  SqlSandwiches Jul 14 '11 at 1:01
add comment

Your Answer


