Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie question on creating index
Message
General information
Forum:
Microsoft SQL Server
Category:
Database design
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01243713
Message ID:
01243914
Views:
23
>Thank you very much! I get it now. If I may ask you another question please. Now in addition to the Primary key index I want to add an index on two columns and make it Unique. So when I create this index on the expression of two columns and define that this index has to be Unique I get exception when SQL Server tries to save the new index. The exception says that I have some rows have duplicate entries (for this new key). My question is, is looking for these rows and fixing them before creating an index is the only way to deal with this?

Yes, you must be sure you didn't have duplicate values in selected columns. I mean if you choose one column - then that column must not have duplicated values in it. If you choose two or more that every possible combination of the values of these columsn must not have duplicated value.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform