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)

Script all indexes as CREATE INDEX statements

By Lowell Izaguirre,

this script will generate CREATE index statements for all indexes in the database;
there are already scripts out there that script constraints for primary keys and unique constraints, which automatically create an index behind the scenes. but what about the other indexes?
uncomment two statements in order to filter out primary keys and Unique indexes so you can get all the other types,

Total article views: 17793 | Views in the last 30 days: 41
Related Articles

script included index

index include script


Script all Indexes

Generate scripts for all indexes in a database


INDEX NAME, TAble Name, Index Script required.

INDEX NAME, TAble Name, Index Script.


Generate Index only scripts for whole DB

scripts indexes database


Scripting Indexes

I was recently reading a blog posting on BIDN, Scripting Indexes with Filters and schemas.In the pos...