I am working on SQL SERVER 200 and I am trying to drop the default constraints set in few tables. I tired to follow the instructions given in MSDN for dropping a default:
1) Unbind the code
Expand|Select|Wrap|Line Numbers
- Exec sp_unbindefault 'tablename.columname'
Server: Msg 15049, Level 11, State 1, Procedure sp_unbindefault, Line 98
Cannot unbind from 'tablename.columname'. Use ALTER TABLE DROP CONSTRAINT.
2) AS ore the second step mentioned in MSDN and from the error message, I tired Alter table drop constraint
Expand|Select|Wrap|Line Numbers
- ALTER TABLE tablename DROP DEFAULT [constraintname]
Incorrect syntax near the keyword 'DEFAULT'.
3) So I try only to use drop default constraint
Expand|Select|Wrap|Line Numbers
- DROP DEFAULT constraintname
The default 'constraintname' cannot be dropped because it is bound to one or more column.
Finally I read few more tutorial, though almost all said the same, I was inclined to try another syntax mentioned in one of them:
4)
Expand|Select|Wrap|Line Numbers
- ALTER TABLE tablename ALTER COLUMN columname DROP DEFAULT constraintname
Incorrect syntax near the keyword 'DEFAULT'.
So finally I have run out of ideas and would be glad if anyone can be of some help. I am sure someone should have come across this issue and maybe found a work around.
Thanks a ton in advance :)
Sree