Listing All Indexes of ALL Databases in SQL Server

In this blog we see, how to list all the Indexes from all the database in SQL Server. 

? – Indicates the name of database.

This will iterate all the database in the sql server and list the sys Indexes as section based on the database.

sp_msforeachdb 'select "?" AS dbName, * from [?].sys.indexes

You can also use like below:

select * from [DatabaseName].sys.indexes 


Thanks for reading this article. 

Have a nice day.

Ebook Download
View all
Learn
View all