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:
01638018
Vues:
40
>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.
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