Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does the order of columns matter?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01639951
Message ID:
01639960
Views:
71
>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

Yes, order of columns matter in the index. Select most selective column first.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform