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 is use of @@ spid in sql server?

1213


Explain rdbms?

1044


What is an identity column in insert statements?

1025


How to execute stored procedure and set temp table in sql server?

1047


How do users use Report Builder with SQL Server data sources?

160


What is faster join or union?

1224


What are the different types of stored procedures?

1117


How to copy data from one table to another table?

998


Can you type more than one query in the query editor screen at the same time?

1011


What are the difference between primary key and unique key? : sql server database administration

945


What are sql azure firewall rules?

106


If you want to send some data from access database to sql server database. What are different component of ssis will you use?

988


How to view the error log for any specific instance? : sql server database administration

1045


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

1152


If a stored procedure is taking a table data type, how it looks?

6452