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

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 Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

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