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

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Google Amazon and Flipkart Book Store!

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book