Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
what is the difference between clustered and non clustered index in sql server. what will we use while designing table in sql server.
Posted 19-Sep-12 23:32pm
Edited 19-Sep-12 23:36pm
v2
Comments
Andrei Straut at 20-Sep-12 4:38am
   
Pst! Look what Google whispered to me[^] when I told him your exact question
Vedangi at 20-Sep-12 4:40am
   
YOu can refer this article
http://www.codeproject.com/Articles/173275/Clustered-and-Non-Clustered-Index-in-SQL-2005
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

While I agree that the best way to answer this would have been google, I will just add that a clustered index is super fast for searches, and slows down deletes and ( to a lesser degree ) changes to data. If you have a primary key on your table, it is a clustered index by default, so if you want to have another clustered index, your primary key needs to be marked NOT clustered.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

A clustered index is a special type of index that reorders the way records in the table are physically stored.
Therefore table can have only one clustered index and this is usually made on the primary key. The leaf nodes of a clustered index contain the data pages.
 
A nonclustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.
There can be as many as 249 nonclustered index per table
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

The basic differences between Primary Key and Unique key are as follows.
1) By default Primary Key will generate Clustured Index
whereas Unique Key will Generate Non-Clustured Index.
2) Primary Key is a combination of Unique and NOT NULL Constraints so it can’t
have duplicate values or any NUll
Whereas for Oracle UNIQUE Key can have any number of NULL whereas for SQL
Server It can have only one NULL
3) A table can have only one PK but It can have any number of UNIQUE Key.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 520
1 Mathew Soji 315
2 Shweta N Mishra 269
3 BillWoodruff 240
4 OriginalGriff 235
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,818
2 DamithSL 4,988
3 Manas Bhardwaj 4,539
4 Maciej Los 3,775


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 26 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100