Skip to content

Instantly share code, notes, and snippets.

@matejskubic
Created June 13, 2018 08:38
Show Gist options
  • Save matejskubic/b6fb63c57fbdb6dd0c11ea6b226d096d to your computer and use it in GitHub Desktop.
Save matejskubic/b6fb63c57fbdb6dd0c11ea6b226d096d to your computer and use it in GitHub Desktop.
List columns on table index [mssql]
select
COL_NAME(ic.object_id, ic.column_id) colName
, *
from sys.index_columns ic
join sys.indexes i
on i.object_id = ic.object_id
and i.index_id = ic.index_id
where i.object_id = object_id('[dbo].[ProjGroup]')
--and i.is_primary_key = 1
--and ic.is_included_column = 0
--and i.name='I_588GROUPIDX'
order by ic.index_id, ic.key_ordinal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment