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


This content was proof-read by Grammarly. You can Try Grammary for FREE

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.


Are you a .NET Developer planning to integrate GraphQL for .NET in your Application? Check out this book BUY & DOWNLOAD GRAPHQL.NET COOKBOOK
How do you check if an index exists in a table?
%d bloggers like this: