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
How to start sql server browser service?
What is the data tier application?
You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?
Explain system views?
How to automatically create a log when an exception is being received into SQL Server?
What are secondary xml indexes?
What are different types of views?
What are the results of running this script?
What do we need queues in sql service broker?
What are different types of replication in sql server?
How do I find my localdb version?
What is the difference between the application object and session object?
How to write a query with a full outer join in ms sql server?
How to get a list of table columns using the "sp_columns" stored procedure in ms sql server?
Does partitioning help performance?