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 a clustered index on composite primary key.

Answer Posted / shatrunjay shukla

Yes
If you are creating a composite Primary Key, or a composite Clustered Index that is NOT a Primary Key, you are creating a single index that uses both column values as the clustering key.

CREATE TABLE T(id INT, cat INT, uName SYSNAME);

CREATE UNIQUE CLUSTERED INDEX ix_T_id_cat ON T (id,cat);



SELECT * FROM SYS.INDEXES WHERE object_id = OBJECT_ID('T');

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which are new data types introduced in sql server 2008?

987


How to add additional conditions in SQL?

969


How to set database to be single_user in ms sql server?

966


What is stored in the mssqlsystemresource database? : sql server database administration

986


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

924


What is Lock table in SQL?

1406


As per your opinion what are the five top responsibilities of a dba? : sql server database administration

1061


what is a self join? Explain it with an example? : Sql server database administration

878


What happens if null values are involved in datetime operations?

898


what is an index? : Sql server database administration

929


What happens if the update subquery returns multiple rows in ms sql server?

1054


What does select 1 mean?

879


Explain the working of sql privileges?

1033


How use inner join in sql server?

1051


How do I install sql server?

841