OK, so far modifying the above statement I get:-select object_name(ic.object_id) [table],i.NAME [index name],COUNT(i.index_id) [column duplicated]FROM sys.index_columns icjoin sys.indexes ion ic.object_id = i.object_idAnd ic.index_id = i.index_idJOIN sys.columns cOn c.object_id = i.object_idAnd c.column_id = ic.index_column_idJOIN sys.tables tOn t.object_id = c.OBJECT_IDGROUP BY ic.object_id,i.nameHAVING COUNT(i.index_id) > 1
Is there now a way of listing all the columns used in the indexes above?