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
What is parameterized reports in ssrs ?
What is an identity?
How much is a sql server license?
How can sql injection be stopped? : sql server security
What does it mean to be in union?
How we can refresh the view?
What is primary key index?
What is sql server profiler trace data file?
What is transaction server implicit?
how to avoid cursors? : Sql server database administration
What are the advantages of passing name-value pairs as parameters?
difference between Clustered index and non clustered index ?
How to get the definition of a trigger back?
What are the requirements to use odbc connections in php scripts?
If I delete a template from the list in sql studio, will it be deleted from the hard disk? : sql server management studio