Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drop column failed
Message
De
09/03/2011 18:36:00
 
 
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:
01503125
Vues:
17
Now, that I am thinking of it more, I have this situation since whatever was created since a few months. If you recall correctly, there was a thread a few months ago and it ended up that I adjusted my ALTER TABLE ADD COLUMN syntax to include in one line the addition of a field and a replace of all actual records with a blank values. Before, I was adding the field and doing an UPDATE after. Now, that this is done in one line using that approach, it creates a constraint. I am not sure I like it. I think I will keep it as it was months ago by adding the field in one line following by another line to update all existing records with a blank value. This will avoid those constraints to be created. Because, I do not need them at the SQL Server level. This is all taken cared of automatically by the framework. We reached that situation because we wanted to initialize with a default values all the existing records. This applied of course for those tables that contain records at the time I execute the command to add a new column. If I use back that approach, I wouldn't even have to bother about checking for constraints and removing them, if any, when I would want to enlarge a column length for example.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform