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: 17729 | Views in the last 30 days: 39
 
Related Articles
FORUM

script included index

index include script

SCRIPT

Script all Indexes

Generate scripts for all indexes in a database

FORUM

INDEX NAME, TAble Name, Index Script required.

INDEX NAME, TAble Name, Index Script.

FORUM

Generate Index only scripts for whole DB

scripts indexes database

BLOG

Scripting Indexes

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

Tags
indexing    
t-sql    
 
Contribute