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
Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?
Where are SQL server users names and passwords are stored in sql server?
what are constraints? : Sql server database administration
How to create a new table in a given schema?
What are statistics?
What is a functions and types in sql server?
Which is better statement or preparedstatement?
What are the advantages of using stored procedures in sql server?
What is collation sensitivity?
Please explain what is “asynchronous” communication in sql server service broker?
How do I find my localdb version?
What command do we use to rename a database?
You want to check the syntax of a complicated update sql statement without executing it. What command should you use?
What are the different editions available in sql server 2000?
What is the default sql server instance name?