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
Why do you need a sql server?
What are key constraints?
A trigger can reference objects outside the current database? State true or false.
Write a SQL query to make a column as unique?
How can I create a report based on a query? : sql server management studio
Explain about Joins?
What is it unwise to create wide clustered index keys?
What is unique key constraint?
Can an automatic recovery be initiated by a user?
How to sort the query output with order by clauses in ms sql server?
Can we use trigger new in before insert?
How to change the ownership of a schema in ms sql server?
What are the disadvantages of using querystrings to send data from one page to another?
Where are full-text indexes stored?
How to optimize stored procedure optimization?