2

I need to find and count all indexes on tables within database, is there any builin SP or i need to write some custom sp for the same.

  • 1
    Possible duplicate of [List of all index & index columns in SQL Server DB](https://stackoverflow.com/questions/765867/list-of-all-index-index-columns-in-sql-server-db) – Nick.Mc May 08 '18 at 12:09

1 Answers1

2
Select COUNT(1) from sys.indexes WHERE TYPE > 0 AND OBJECTPROPERTY(object_id,'IsSystemTable')=0
  • 1
    While this answer is probably correct and useful, it is preferred if you include some explanation along with it to explain how it helps to solve the problem. This becomes especially useful in the future, if there is a change (possibly unrelated) that causes it to stop working and users need to understand how it once worked. – Erty Seidohl May 08 '18 at 21:13