Solved

Primary key as NC

Posted on 2010-08-13
4
246 Views
Last Modified: 2012-05-10
Is it possible for a PK to a NC instead of being clustered. When I create a PK, it automatically gets created as Clustered.

thanks
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 250 total points
ID: 33431984
Absolutely...by default sql makes it clustered unless otherwise specified

create table tablename(fld1 int not null, constraint pk_tablename primary key nonclustered (fld1))
0
 
LVL 16

Assisted Solution

by:vdr1620
vdr1620 earned 250 total points
ID: 33432503
0
 
LVL 6

Author Comment

by:anushahanna
ID: 33432814
Thanks.
0
 
LVL 22

Expert Comment

by:dportas
ID: 33440881
In fact if you create a PRIMARY KEY constraint on a table that already has a clustered index then the PRIMARY KEY will automatically be created as a nonclustered index unless you specify otherwise.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question