Multiple indexes on the same column

  • Guys,

    Is there anyway from system objects I can find all the columns which have more than one index on it with different names?

    Any suggestions/inputs would be helpful.

    Thanks

  • A quick query to get that;

    select object_name(ic.object_id) as object_name, i.name as index_name, COL_NAME(object_id('Sessions'), ic.column_id) as column_name

    from sys.index_columns ic join sys.indexes i

    on ic.index_id = i.index_id

    where ic.object_id = object_id('Sessions')

    I'm sure there are more elegant ways....

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply