How to Create Index in SQL

In this article I am going to explain how to create index in SQL.
  • 2277


Index in SQL is used to quickly access the data from table or view. Indexes are created on table or view. Database have large amount of data like thousands of tables and view. When we try to access this data it takes more time.

SQL provide a way known as index through we can access a specific data quickly. CREATE INDEX statement is used to create a index.

Type of index in SQL

  • Clustered index
  • Non clustered index
  • Unique index
  • Columnstore index

Statement that create index

create index indexmcn on mcnemp (id)

Statement that create index using two column

create index indexmcn2 on mcnemp (id,name)

© 2020 DotNetHeaven. All rights reserved.