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
 General SQL Server Forums
 New to SQL Server Programming
 indexes

Author  Topic 

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-05-30 : 12:55:53
Q1
The table i have stores max 2000 records. Not sure if i neeed a clustered index for this few records. I guess not.


Q2
For the same table as above. How do you create primary keys if there is not unique records.
Do i create a new column? like newColumnID identity? and create a primary key on this new column? Ok even if i create this newcolumn. I don't think it will improve the retrieving speed cause i'm not selecting this column.

Opinions, ideas?


nr
SQLTeam MVY

12543 Posts

Posted - 2007-05-30 : 13:16:09
Q1 - why not? An index might not help queries but probably wouldnt hurt. Some say that all tables should have a clustered index (I don't).

Q2
>> For the same table as above. How do you create primary keys if there is not unique records.
You can't - and it's not a table if eows aren't unique.
A PK doesn't help performance - it's just an index.



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-30 : 16:24:09
You can use keys to enforce data integrity.
Go to Top of Page
   

- Advertisement -