Home
> Uncategorized > Changing a default on a column on SQL
Changing a default on a column on SQL
If you set a default value to a column, then try to drop that column, in MS SQL, you sometimes get obscure errors like this.
Server: Msg 5074, Level 16, State 1, Line 1
The object ‘DF__question_v__type__50C5FA01’ is dependent on column ‘type’.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN type failed because one or more objects access this column.
The object ‘DF__question_v__type__50C5FA01’ is dependent on column ‘type’.
Server: Msg 4922, Level 16, State 1, Line 1
ALTER TABLE DROP COLUMN type failed because one or more objects access this column.
I have found that this can be fixed with this command:
alter table question_values drop constraint DF__question_v__type__4FD1D5C8
Where the table name would be changed to fit your own purposes.
Categories: Uncategorized
Comments (0)
Trackbacks (0)
Leave a comment
Trackback