Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding constraint to a table
Message
De
13/03/2008 18:08:39
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Adding constraint to a table
Divers
Thread ID:
01301994
Message ID:
01301994
Vues:
52
Am I correct to say that when we add a constraint to a table, such as for a primary key, that the name given has to be unique in the database? I have 120 tables where I have to define a constraint of type primary key and the field name is all Numero. So, all 120 tables have a field Numero. So, this means, if I do:
ALTER TABLE [Client] ADD CONSTRAINT Numero PRIMARY KEY (Numero)
that, it will work. But, doing another line following that one with:
ALTER TABLE [Country] ADD CONSTRAINT Numero PRIMARY KEY (Numero)
will not work because a constraint Numero already exists.

This irritates me because even if the field being defined as a primary key is Numero, the name that it will appear under under the Keys, Indexes and Statistics section would be the unique name I will have to give it. So, if I want to define the Numero field in all my tables as a primary key, is there a way to have it to be shown as Numero for each table under those 3 sections?
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform