CREATE INDEX, why do we need to create index at SQL table? By create index in table will help to locate rows more quickly and efficiently. You can create UNIQUE, CLUSTERED and NONCLUSTERED index.

For example,

CREATE INDEX index_name ON table_name (column_name)

Above is the simple way to create an index into a table. By default, NONCLUSTERED INDEX is created. So what does UNIQUE, CLUSTERED and NONCLUSTERED index mean?

UNIQUE
Creates a unique index on a table or view. A unique index is one in which no two rows are permitted to have the same index key value. A clustered index on a view must be unique.

CLUSTERED
Creates an index in which the logical order of the key values determines the physical order of the corresponding rows in a table.

NONCLUSTERED

Creates an index that specifies the logical ordering of a table. With a nonclustered index, the physical order of the data rows is independent of their indexed order.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Reddit
  • Facebook
  • Google
  • Live
  • YahooMyWeb
  • Furl
  • Slashdot
  • Spurl
  • Mixx
  • BlinkList
  • Bumpzee

Tags: