Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)


By Pedro Lopes MS,

(SQL 2005) Creates Index Creation statements based on info colected in system view sys.dm_db_missing_index_details, either with included columns or just In(Equality) columns.

EDIT: Statements are shown in results pane because of need to properly indent the output code.

EDIT2: Added check for redundant indexes, so dba can opt out of creating them.

EDIT3: Wrong drop statements fixed.

Total article views: 989 | Views in the last 30 days: 5
Related Articles

Missing Index Script with Create Statement

standard missing index script but has a create statement to copy and past


Referencing indexes in a SQL statement

Referencing indexes in a SQL statement


Scripting CREATE INDEX Statements Automatically From Your Tables

Stored proc for scripting out full CREATE INDEX statements from your table indexes with all filegrou...


Indexing During an INSERT INTO Statement

Automatic indexing while appending


Generate Create FK-indexes

Generate create statements for missing FK indexes, based on DRI

sql server 2005