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 clustered index on non primary key column

Answer Posted / selvaraj.v

No, Because Constraints must have integrity. These are,
Clustered and Non-Clustered. So, to use Primary key with
any one Clustered or Non-Clustered index.

Example in SQL Server 2000:
Query :
-------
create table BookDetails
(
Book_ID int identity(1,1) not null clustered,
Book_Title varchar(20),
Book_Type varchar(15),
Book_Author varchar(25),
Book_Edition float,
Book_Publisher varchar(20),
Book_Pub_Year datetime,
Book_Price int
)

Answer:
-------
Server: Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'clustered'.

Prevent this Error To use Clustered Primary Key:
------------------------------------------------
Query In SQL Server 2000:
-------------------------

create table BookDetails
(
Book_ID int identity(1,1) not null primary key clustered,
Book_Title varchar(20),
Book_Type varchar(15),
Book_Author varchar(25),
Book_Edition float,
Book_Publisher varchar(20),
Book_Pub_Year datetime,
Book_Price int
)

Answer:
-------
The command(s) completed successfully.

Is This Answer Correct ?    4 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are number line correlation administrators will use while working with a subquery?

1097


List out the difference between union and union all in sql server?

919


What are the disadvantages of using querystrings to send data from one page to another?

931


You want your report to display a hyperlink that will take users to your intranet. How do you configure such a hyperlink?

304


how would you troubleshoot blocking? : Sql server database administration

942


How to perform key word search in tables?

910


When to use null data driven subscription?

196


Do you know what is fill factor and pad index?

940


How to create new table with "create table" statements?

994


What is sql server replication? : sql server replication

923


What is a with(nolock)?

925


How do you use a subquery to find records that exist in one table and do not exist in another?

991


How many types of local tables are there in sql server?

887


What are examples of triggers?

1019


Do you know what is sql service broker?

995