Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop column failed
Message
 
 
To
09/03/2011 18:16:24
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01503074
Message ID:
01503121
Views:
21
>>Peter suggests to check the indexes (if any index includes this field).
>>
>>You can check indexes using
>>sp_HelpIndex SP.
>>
>>In addition, the field can be used in Check constraint.
>
>You may say thanks to him. But, I believe it goes back to what I was saying earlier on today. I see some items in Constraints. When I removed them all, I was able to run the script. I believe the DEFAULT WITH VALUES clauses add item in the constraint list.
>
>So, basically, I will have to adjust my script to remove all the constraint related to the field I need to remove before executing the ALTER TABLE DROP COLUMN line.
>
>I also found it quite confusing that when we remove a constraint manually from SSMS that it doesn't get removed. It is, but we have to force a refresh to get the updated list.

The default constraint was the one preventing the executuon of the DROP COLUMN. I now realized it myself, you do need to drop all constraints referecing the field prior to dropping the field.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform