Posts Create missing index on a table on SSMS 2008 and above
Post
Cancel

Create missing index on a table on SSMS 2008 and above

or

execute your query

1
2
3
4
5
6
7
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).

1
2
3
4
5
6
7
USE [AdventureWorks]
GO

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

GO

name the INDEX name

1
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/

origin - https://www.pipiscrew.com/?p=14499 create-missing-index-on-a-table-on-ssms-2008-and-above

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags