August 5, 2012 at 11:29 pm
Hi Guys...Please let mi Clarify The is it Possible to '
Can we create clustered index on non primary key column '
Because when i was tried in a sample table without primary key. and cluster index it was creating and as well as accepting nulls and duplicates also..
i was attached those pics are in below...
please kindly clarify my doubt frds.....!
August 5, 2012 at 11:51 pm
pavanpala.vja (8/5/2012)
Can we create clustered index on non primary key column '
Yes.
Because when i was tried in a sample table without primary key. and cluster index it was creating and as well as accepting nulls and duplicates also..
That is expected behavior.
August 5, 2012 at 11:54 pm
Hi suresh thanks for ur reply..
can u please clarify my doubt then..
So.......If u create an unique Clustered index On a table then is it allow...Nulls and duplicate values the.....By default..?
August 5, 2012 at 11:56 pm
Yes we can create Clustered Index on a non-unique and nullable column.
If the clustered index is not a unique index, SQL Server makes any duplicate keys unique by adding an internally generated value called a uniqueifier.
For more information read BOL.
August 6, 2012 at 12:10 am
pavanpala.vja (8/5/2012)
So.......If u create an unique Clustered index On a table then is it allow...Nulls and duplicate values the.....By default..?
Unique Clustered Index does not allow duplicate values.
Single NULL value is considered as a unique value.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply