Search This Blog

2015-06-19

MS SQL Server: Finding Table's Index Count

Product: MS SQL Server
Version: 2005 - 2012

Following SQL can be used to find out number of indexes per table

select top 20 OBJECT_NAME(i.object_id) table_name , count(1) n_idx from sys.indexes i
where OBJECT_NAME(i.object_id) like 'c%'
group by object_id
having COUNT(1) > 10

In above SQL, I only listing tables which have more than 10 indexes, and limiting to first 20 rows.  You can adjust them to meet your need

No comments: