Can we create a clustered index on composite primary key.
Answer Posted / anil kumar
Here's the procedure:
Create a table with no primary key defined.
Create clustered index on the primary key columns.
Alter the table to define the primary key.
Table creation:
create table CDSWEB.Anil (officeid integer not null,
empid integer not null,
age integer ,sex varchar(5),
name varchar(20));
Index creation:
create index CDSWEB.AN001 on CDSWEB.Anil(officeid,empid)
CLUSTER;
Primary key defined:
alter table CDSWEB.ANIL
add primary key (officeid,empid);
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
Explain how to integrate the ssrs reports in application?
What is 3nf normalization form?
How do I view a procedure in sql server?
How do I debug a stored procedure in sql server?
What is order of B+tree?
Can one drop a column from a table?
what's the difference between a primary key and a unique key? : Sql server database administration
In what three ways is the return statement used in a stored procedure?
Name 3 ways to get an accurate count of the number of records in a table?
Can you explain what are various ways to enhance the ssrs report?
What is sql service broker?
Which tools are available to manage SQL Azure databases and servers?
How will you find out if there are expensive SQL statements running or not?
Is profiler the only tool that has the ability to audit and identify ddl events? : sql server security