Solved

Primary key as NC

Posted on 2010-08-13
4
240 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
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

705 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now