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
What are the results of running this script?
What is ems sql management studio? : sql server management studio
Can you force a query to use a specific index?
how many bits ip address consist of? : Sql server database administration
why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration
Why use triggers?
What are the indexes in sql server?
how to avoid cursors? : Sql server database administration
What stored by the model? : sql server database administration
Explain try...catch with sql server?
How to link tables in sql server?
What are the elements of dbms?
my name is sejal I have cleared the sbi clerk exam. I am BCA graduate My favorite subject RDBMS Relational database management system. so please send me rRDBMS related interview questions
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
Do you know the cursor types?