Reputation: 23
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'.
Upvotes: 2
Views: 3618
Reputation: 16144
Look up the name of the default constraint, and drop the constraint by name:
ALTER TABLE [table_name] DROP CONSTRAINT [constraint_name];
Upvotes: 1