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

What is parameterized reports in ssrs ?

147


What is an identity?

997


How much is a sql server license?

940


How can sql injection be stopped? : sql server security

1023


What does it mean to be in union?

925


How we can refresh the view?

1102


What is primary key index?

969


What is sql server profiler trace data file?

1100


What is transaction server implicit?

993


how to avoid cursors? : Sql server database administration

962


What are the advantages of passing name-value pairs as parameters?

1159


difference between Clustered index and non clustered index ?

982


How to get the definition of a trigger back?

995


What are the requirements to use odbc connections in php scripts?

1104


If I delete a template from the list in sql studio, will it be deleted from the hard disk? : sql server management studio

970