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 is difference between sql and sql server?
What is transact-sql language?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
How can we solve concurrency problems?
Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?
What is data block and how to define data block size?
Explain few of the new features of sql server 2008 management studio
what is the difference in login security modes between v6.5 and 7.0? : Sql server database administration
How to create an index on a view?
How to add a new dsn with the odbc driver for sql server?
How can we remove orphan records from a table?
What is sql azure database?
What is the difference between ddl,dml and dcl commands?
What is the default fill factor value?
What is a data source file?