Create missing index on a table on SSMS 2008 and above

or

execute your query

USE AdventureWorks 
GO

SELECT CustomerID, Name, SalesPersonID, ModifiedDate 
FROM Sales.Store 
WHERE (Name='Bike World' AND ModifiedDate > '2004-10-01')
GO

If dbase needs an INDEX, will appear this ‘Missing Index’ green line.

Right click > Missing Index Details

This will generate T-SQL code for the missing index (SQL Server 2008 Management Studio).

USE [AdventureWorks]
GO

CREATE NONCLUSTERED INDEX []
ON [Sales].[Store] ([Name],[ModifiedDate])

GO

name the INDEX name

CREATE NONCLUSTERED INDEX [IDX_Store_Mod_Date]

#create #index #missing

src – https://www.mssqltips.com/sqlservertip/1945/missing-index-feature-of-sql-server-2008-management-studio/

By: |16/12/2018|categories: