Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing PK from non-clustered to clustered
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01637980
Message ID:
01638019
Vues:
44
>>I think originally this column was not INT but NUMERIC(6,0) and I later changed it to INT. Could this have confused SQL Server and caused the PK column to be non-clustered?
>
>It all depends on how exactly you created that PK originally. By default SQL Server tries to make the PK column a clustered index if you do it using the designer. I don't think numeric(6) vs. integer would have made a difference.
>
>Of course, it's easy to test - just create a new table with few columns and a numeric(6,0) column, set it to be a PK and then see what is the generated script. Then just don't save changes in the designer or if the table will be created, just drop it.

Good suggestion. If I have time today (between putting down the fires), I will do it. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform