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

Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

991


Where are SQL server users names and passwords are stored in sql server?

1321


what are constraints? : Sql server database administration

1123


How to create a new table in a given schema?

1246


What are statistics?

1047


What is a functions and types in sql server?

1141


Which is better statement or preparedstatement?

979


What are the advantages of using stored procedures in sql server?

1047


What is collation sensitivity?

1131


Please explain what is “asynchronous” communication in sql server service broker?

977


How do I find my localdb version?

1022


What command do we use to rename a database?

1113


You want to check the syntax of a complicated update sql statement without executing it. What command should you use?

1038


What are the different editions available in sql server 2000?

1109


What is the default sql server instance name?

1081