Thursday 13 July 2017

why only one clustered index per tabl?e

Cluster index are sorted physically ,the data at the leaf node are sorted on only one particular order since there will be only one cluster index can be created and having its index table associate with leaf node(data page).
Cluster index can also be created for two columns(composite cluster indexing) also,but only one clustered index per table.

Example for cluster index :Telephone book is ordered in the alphabetic way, for example there are two names called raju then it will sort first with first name and then with last name


Non-Clustered index:The data is in leaf node(data page),and are not in order where the row pointer are pointing to the leaf node where the data is located.
the table can have more then one non cluster indexing.

Example for non cluster indexing :Index on books in front page,where the page number points to that particular topic in the book,But it is not ordered in the one particular way.A table can have more then one non cluster index.


Msg 1902, Level 16, State 3, Line 1

Cannot create more than one clustered index on table 'sales'. Drop the existing clustered index 'CI_Sal_ID' before creating another.

No comments:

Post a Comment

Recent Post

Parallel Task in .Net 4.0