Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change DB Structure with FOREIGN KEY constraint
Message
 
 
À
06/07/2010 16:16:20
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Scripting
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01471590
Message ID:
01471591
Vues:
38
>I have been learning SQL 2008. After creating a few related tables, I added a few additional column to one of the tables. When I attempt to save the table structure I get an error telling me that the table can not be dropped and re-created.
>
>1. Why when added a new column does SQL need to drop the original and re-create it?
>
>2. If the constraint are the problem, why doesn't SQL drop the constraints and recreate them?

If you're using SSMS Design view it generates safer, but often more complex script than needed. You may be better if you use ALTER TABLE directly and not the design view.

Try saving the script right now (click on script button) and abandon this dialog. Then based on this script write correct query.
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