Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Could someone help me with an index please?

Author  Topic 

JBelthoff
Posting Yak Master

173 Posts

Posted - 2003-01-21 : 20:40:37
Hi All,

I have a table that collects information form users.

I have many fields, but the identifying field is "Email".

I have an autoincrement "ID" field that is a nonclustered Primary Key. I have a UNIQUE Constraint on the "Email" field.

I would like to have the Email field also be a clustered index.

Here is the question[s].....

If the "Email" field already has a UNIQUE constraint, do I need to add a UNIQUE CLUSTERED INDEX or just a CLUSTERED INDEX?

or

Can I drop the UNIQUE Constraint and just use the UNIQUE CLUSTERED INDEX to achieve the same thing?

Could someone expand on this please? I'm a little confused.

Thanks,

JB



harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-01-21 : 23:18:35
quote:

If the "Email" field already has a UNIQUE constraint, do I need to add a UNIQUE CLUSTERED INDEX or just a CLUSTERED INDEX?

or

Can I drop the UNIQUE Constraint and just use the UNIQUE CLUSTERED INDEX to achieve the same thing?




I think you can go with the second option.But still will have to analysie the use of the table I would suggest to run the index tunning wizard if the table is that big and u have a large number of records.


Expect the UnExpected
Go to Top of Page

rihardh
Constraint Violating Yak Guru

307 Posts

Posted - 2003-01-22 : 02:20:03
There's plenty on indexes and constraints in BOL. Don't mix them. Everyone of them has its own functionality which I won't explain here.

Read BOL and you'll find the answer.

Go to Top of Page

rihardh
Constraint Violating Yak Guru

307 Posts

Posted - 2003-01-22 : 02:21:02
Oh, and by the way, did you notice the button on the "indexes" form wich says "Help"?

Go to Top of Page
   

- Advertisement -