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

How to start sql server browser service?

1141


What is the data tier application?

169


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

122


Explain system views?

1093


How to automatically create a log when an exception is being received into SQL Server?

1297


What are secondary xml indexes?

1031


What are different types of views?

948


What are the results of running this script?

937


What do we need queues in sql service broker?

1073


What are different types of replication in sql server?

1093


How do I find my localdb version?

989


What is the difference between the application object and session object?

1077


How to write a query with a full outer join in ms sql server?

1086


How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?

1016


Does partitioning help performance?

939