You can find out if the index exists for a table by querying the sys.indexes table as shown in this blog post’s code sample.

How do you check if an index exists in a table?

Use AdventureWorks2014
GO
SELECT * 
FROM sys.indexes 
WHERE object_id = OBJECT_ID('HumanResources.Employee')

This will list out all the indexes of the table.

How do you check if an index exists in a table?

Leave a Reply

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

Liked this content?. Please spread the word :)

  • RSS
  • Twitter
    Visit Us
    Follow Me