Create Function in SQL Server

What is Nonclustered Index? How to create Nonclustered Index?

What is Nonclustered Index?
Non-Clustered Index,
1.      Non-clustered indexes can be used more than one time per table.
2.      Non-clustered indexes store logical structure but clustered indexes store in physical order.
3.      Faster for insert and update operations than a clustered index.
4.      Improve the performance when select data with index fields.
5.      Non-clustered indexes are stored separately.
6.      We can add only 249 non-clustered indexes for a table.
7.      Non-clustered indexes made on the any key but clustered indexes only on primary keys.

How to create Nonclustered Index?
-- CREATE NONCLUSTERED INDEX
CREATE NONCLUSTERED INDEX Indexname_Employee ON Employee
(
    [EmpName] ASC --OR DESC,
    [EmpDepartment] ASC --OR DESC
)

-- OR
-- CREATE NONCLUSTERED INDEX
CREATE NONCLUSTERED INDEX [Indexname_Anil1] ON [dbo].[Emply]
(
    [EmpName] ASC,-- OR DESC,
    [EmpDepartment] ASC-- OR DESC
)
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