views:

28

answers:

1

A while back when I was performing some bulk inserts of data into my SQL Server database, I disabled a number of indexes to improve the insert performance. I now need to go back and rebuild/re-enable them.

Unfortunately, I'm not sure exactly which indexes I disabled.

Is there a way I can query to identify which indexes are disabled and should be re-enabled?

+3  A: 
select
    sys.objects.name,
    sys.indexes.name
from sys.indexes
    inner join sys.objects on sys.objects.object_id = sys.indexes.object_id
where sys.indexes.is_disabled = 1
order by
    sys.objects.name,
    sys.indexes.name
Daniel Renshaw