How To Create Index – Azure Data Studio

Using Index on Table ,It helps User to Search Specific values fast .

Syntax : -
-- Create a nonclustered index with or without a unique constraint
-- Or create a clustered index on table '[TableName]' in schema '[dbo]' in database '[DatabaseName]'

CREATE /*UNIQUE or CLUSTERED*/ INDEX IX_IndexName ON [DatabaseName].[dbo].[TableName] ([ColumnName1] DESC) /*Change sort order as needed*/

Writing Queries To Create Index.

Example of creating index . Database Name : Adam , Table : Departments, Column : Department_ID
Righ Click on Script as Create. Then u can find nonclustered index created on table.
by executing sp_helpindex on table. You get description on index.

Post Author: adama