List all indexes for all tables in a SQL Server database

To list all indexes for all user tables in a database, you can use this code (in this example we use AdventureWorks sample database):

USE AdventureWorks
SELECT DB_NAME() AS Database_Name
, AS Schema_Name
, AS Table_Name
, AS Index_Name
, i.type_desc AS Index_Type
FROM sys.indexes i
INNER JOIN sys.objects o ON i.object_id = o.object_id
INNER JOIN sys.schemas sc ON o.schema_id = sc.schema_id
AND o.type = 'U'
ORDER BY, i.type

List all SQL Server database indexes

The results show the database name, schema name, table name, index name and index type (CLUSTERED, NONCLUSTERED, XML, SPATIAL...) for all user-defined tables (type = 'U' in sys.objects).

Read previous blog post about how to list all fragmented indexes in a database:
Getting Table and Index names for fragmented indexes in SQL Server