Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 Help Members By Posting Answers For Below Questions

What are the different index configurations a table can have?

899


What is outer join in sql server joins?

1045


What is a virtual table in sql?

943


What is normalization? What number of normalization shapes are there?

1054


Can you explain what is indexed view? How to create it?

851


Is sql server 2016 free?

885


What do you mean by an execution plan?

1051


what is a deadlock? : Sql server database administration

981


How many partitions a clustered index has by default in sql server 2012?

1050


Do you know what is similarity and difference between truncate and delete in sql?

959


Explain what role entity and relationship play in an ER diagram.

1017


explain different types of constraints? : Sql server database administration

914


How to provide values to user defined function parameters?

968


What is the server name for sql management studio?

948


What is tcl in sql server?

1076