zaagan
8/10/2019 - 2:32 PM

MS SQL Nonclustered Index

MS SQL Nonclustered Index

GO  
-- Find an existing index named index_name
-- and delete it if found.   
IF EXISTS (SELECT name FROM sys.indexes  
            WHERE name = N'index_name')   
    DROP index_name ON schema.tableName;   
GO  

CREATE NONCLUSTERED INDEX
    index_name ON schema.tableName (ColName);   
GO