case in sql server 2008 r2

What is clustered Index? How to create clustered Index?

What is clustered Index?
1.      The clustered Index is created automatically on primary key column.
2.      One table can only create one and only clustered Index.
3.      Clustered index is sorting all the rows physically.
4.   Clustered index is works based on the Binary tree concept.

How to Create Clustered Index?
-- CREATE CLUSTERED INDEX
CREATE CLUSTERED INDEX Indexname_EmlloyeeClust ON Employee
(
    [EmpName] ASC or DESC,
    [EmpDepartment] ASC or DESC
)

-- OR

-- CREATE CLUSTERED INDEX
CREATE CLUSTERED INDEX Indexname_EmlloyeeClust ON Employee
(
   [EmpName] ASC,
   [EmpDepartment] ASC
)
WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF,
IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON,
ALLOW_PAGE_LOCKS  = OFF)
ON [PRIMARY]

I hope you enjoying with this post! Thank you very much!
ANIL SINGH

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.
^