Select all indices from a database in Microsoft SQL Server 2005

select
    [name]
from
    sysindexes (nolock)
where ([name] not like ‘PK%’)
    and ([name] not like ‘_WA%’)
    and ([name] not like ‘sys%’)
    and ([name] not like ‘ncsys%’)
    and ([name] not like ‘tsys%’)
    and ([name] not like ‘ucsys%’)
    and ([name] not like ‘nc1sys%’)
    and ([name] not like ‘nc2sys%’)
    and ([name] not like ‘tdtproperties’)
order by [name]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.