Incorrect syntax near the keyword 'DEFAULT' in SQL Server

Viewed 1845

I prepared below script to drop default value column.

ALTER TABLE [TableName] 
ALTER COLUMN [ColumnName] DROP DEFAULT;

But It has following error

Msg 156, Level 15, State 1, Line 3 Incorrect syntax near the keyword 'DEFAULT'.

1 Answers

Look up the name of the default constraint, and drop the constraint by name:

ALTER TABLE [table_name] DROP CONSTRAINT [constraint_name];
Related