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
Which are new data types introduced in sql server 2008?
How to add additional conditions in SQL?
How to set database to be single_user in ms sql server?
What is stored in the mssqlsystemresource database? : sql server database administration
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
What is Lock table in SQL?
As per your opinion what are the five top responsibilities of a dba? : sql server database administration
what is a self join? Explain it with an example? : Sql server database administration
What happens if null values are involved in datetime operations?
what is an index? : Sql server database administration
What happens if the update subquery returns multiple rows in ms sql server?
What does select 1 mean?
Explain the working of sql privileges?
How use inner join in sql server?
How do I install sql server?