Can we create clustered index on non primary key column

Answer Posted / vamsi krishna

Create table Testing(testingID int,testingdesc varchar(20))
Note: I am not defining TestingID as primaryKey
create clustered index IX_TestingID on Testing(TestingID)
-- This will allow u to insert duplicate values to the
column that has clustered index created.

Instead run the below command to create unique Clustered
Index
create unique clustered index IX_TestingID on Testing
(TestingID)

-- The above statment will not allow u to add duplicate
records.
For your better conformation insert some records into the
tabel and execute a select statement having the clustered
index column in the where clause and check the execution
plan. You can see Index Seek.

Conclusion : Clustered index can be created on non
primaryKey column

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where actually sql azure database is hosted?

149


What is the maximum size of sql server database?

496


What are the components of dbms?

521


What is exporting and importing utility?

601


How is SQL Azure different than SQL server?

91






how to trace the traffic hitting a sql server? : Sql server database administration

1116


How do you drop an index?

494


Explain about remote stored procedure?

580


What is data mart? : sql server analysis services, ssas

581


What is sql server database?

490


What is thr feature of change data capture?

498


Explain the different types of joins?

558


if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration

518


what are the Prerequisites for Replication?

10552


What are the acid properties?

545