Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does the order of columns matter?
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01639951
Message ID:
01639963
Vues:
49
>>When creating a unique index and FK constraint on two columns, does the order of columns matter?
>>
>>For example, I want to have unique index on SITE_NO (Int) and CATEGORY (Char(20) and a FK Constraint on these two fields. Would [SITE_NO],[CATEGORY] create different "results" from [CATEGORY],[SITE_NO]?
>>
>>TIA
>
>Those 2 different indexes. While it doesn't matter for FK, it may matter for queries. Also logically [SITE_NO],[CATEGORY] makes more sense

Thank you. I am most concerned about FK. And I chose the [SITE_NO],[CATEGORY]. But now my ALTER TABLE... CREATE CONSTRAINT ... fails. I will have to either resolve it myself or start a new thread.
"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