This portal is to share my acquired knowledge related to Sql Server. I hope will be helpful for novice and professionals.

Friday, October 22, 2010

Primary Key Without Clustered Index

We have read/heard many times that clustered index is created when we create Primary key on column.

But is it possible to create PK witout Clustered Index?

Yes it is possible but one of the index will created either Clustered or NonClustered .

See SQL:

Create Table dbo.PKWithoutCLIdx
(
ID Int Primary Key NONCLUSTERED
)

In this way we can force SQL Server to created NonClustered on Primary Key.


Thanks,
Randhir

No comments: