Primary key as NC

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
LVL 6
anushahannaAsked:
Who is Participating?
 
chapmandewConnect With a Mentor Commented:
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
 
anushahannaAuthor Commented:
Thanks.
0
 
dportasCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.