Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Find an index with a specific name
select * from sys.tables as t
inner join sys.columns as c
on t.object_id = c.object_id
inner join sys.index_columns as ic
on c.column_id = ic.column_id and c.object_id = ic.object_id
inner join sys.indexes as i
on ic.index_id = i.index_id and ic.object_id = i.object_id
WHERE = 'table_name' AND = 'index_name'
-- where = 'table_name' and = 'column_name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment