create a non clustered index sql

Solutions on MaxInterview for create a non clustered index sql by the best coders in the world

showing results for - "create a non clustered index sql"
Aymen
24 Jan 2021
1USE AdventureWorks2012;  
2GO  
3-- Find an existing index named IX_ProductVendor_VendorID and delete it if found.   
4IF EXISTS (SELECT name FROM sys.indexes  
5            WHERE name = N'IX_ProductVendor_VendorID')   
6    DROP INDEX IX_ProductVendor_VendorID ON Purchasing.ProductVendor;   
7GO  
8-- Create a nonclustered index called IX_ProductVendor_VendorID   
9-- on the Purchasing.ProductVendor table using the BusinessEntityID column.   
10CREATE NONCLUSTERED INDEX IX_ProductVendor_VendorID   
11    ON Purchasing.ProductVendor (BusinessEntityID);   
12GO  
13