How to List all Disabled Indexes in a SQL Server Database

To list all disabled indexes in a SQL Server database, use the following code:


USE Database_Name
GO
SELECT i.name AS Index_Name, i.index_id, i.type_desc, s.name AS 'Schema_Name', o.name AS Table_Name
FROM sys.indexes i
JOIN sys.objects o on o.object_id = i.object_id
JOIN sys.schemas s on s.schema_id = o.schema_id
WHERE i.is_disabled = 1
ORDER BY
i.name
GO

list_disabled_indexes