Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is difference between sql and sql server?

990


What is transact-sql language?

1080


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1212


How can we solve concurrency problems?

1046


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

1180


What is data block and how to define data block size?

1017


Explain few of the new features of sql server 2008 management studio

907


what is the difference in login security modes between v6.5 and 7.0? : Sql server database administration

1122


How to create an index on a view?

1062


How to add a new dsn with the odbc driver for sql server?

1052


How can we remove orphan records from a table?

978


What is sql azure database?

206


What is the difference between ddl,dml and dcl commands?

1106


What is the default fill factor value?

1074


What is a data source file?

965