Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drop column failed
Message
 
 
À
09/03/2011 18:28:56
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:
01503124
Vues:
14
>>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.
>
>Those that were causing me problems was because they have been created with the DEFAULT WITH VALUES clauses. All the fields that are created from the framework have a default values in the existing records (a blank value), in order to avoid NULL everywhere. Those that were created before do not have any constraint related to them. So, that explains it all. I have found a SQL that list the constraint for a column. Then, if one is found, I will remove it before proceeding. That will resolve the issue.
>
>Thanks

The default value in the column generates a constraint. So, it's not WITH VALUES that is problematic. The DEFAULT value should produce a constraint (unless it was created with now deprecated syntax of bind default).
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