How do you drop a default value from a column in a table?

Viewed 96280

How do you alter a column to remove the default value?

The column was created with:

 ALTER table sometable Add somecolumn nchar(1) NOT NULL DEFAULT 'N'

And then altered with:

 alter table sometable alter column somecolumn nchar(1) null

That allows nulls, but the default value remains. How can you remove it?

7 Answers

I also had the same problem, and altered the table and added Default value the same way as you did. But non of the above solutions solved my problem because despite several refreshes the default value was not listed in the constraint list however it was functioning while inserting into table.

I finally solved it by right clicking the table name in SQL Management Studio and selecting Design. Then I deleted the default values there in the column properties.

Related