Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drop column failed
Message
 
 
À
09/03/2011 18:16:24
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01503074
Message ID:
01503121
Vues:
19
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform