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 a document index?
What do you mean by SQL injection attack?
You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?
Explain something about security and SQL Azure?
What is the difference between dbcc indexdefrag and dbcc reindex?
What is a fan-out query in SQL Azure?
What is after dml trigger?
What is Federation and Federation Member?
How to view the error log for any specific instance? : sql server database administration
What is transaction server consistency?
What were the latest updates to SQL Azure service?
How can you insert null values in a column while inserting the data?
how to overcome kernel isssues
What is a group function explain with an example?
can you implement data mining in SSRS?