December 20, 2013 at 9:25 am
When we create Primary key on a table by default it will create clustered index automatically. If I don't want create any indexes on that table but just I want to create primary key on that table how can we do?
How the primary key makes the table unique but how unique key makes column unique in the table. Please give me good example to understand this..
December 20, 2013 at 9:28 am
You can't. Any primary key or unique constraint is enforced by an index. You can choose a non clustered index for the primary key if you prefer.
John
December 20, 2013 at 11:21 am
You can create a primary key and use the word NONCLUSTERED to force it to not be a clustered index.
But, other than that, you've got the answer. Unique constraints create indexes.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 21, 2013 at 9:38 am
Thank you
December 21, 2013 at 11:09 pm
ramana3327 (12/20/2013)
When we create Primary key on a table by default it will create clustered index automatically. If I don't want create any indexes on that table but just I want to create primary key on that table how can we do?How the primary key makes the table unique but how unique key makes column unique in the table. Please give me good example to understand this..
Please give me good example to understand why you want a table with no indexes?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply