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?
Its a default constraint, you need to perform a:
If you didn’t specify a name when you created the constraint, then SQL Server created one for you. You can use SQL Server Management Studio to find the constraint name by browsing to the table, opening its tree node, then opening the Constraints node.
If I remember correctly, the constraint will be named something along the lines of DF_SomeStuff_ColumnName.
EDIT: Josh W.’s answer contains a link to a SO question that shows you how to find the auto generated constraint name using SQL instead of using the Management Studio interface.