Q&A for SharePoint enthusiasts
-- sp_helpindex 'Users' select object_name(i.object_id) [table] , i.name [index name] , i.type_desc , co.name [column name] , case ico.key_ordinal when 0 then 'included' else 'key col' end --, i.* --, ico.* from sys.indexes i inner join sys.index_Columns ico on ico.object_id = i.object_id and ico.index_id = i.index_id inner join sys.columns co on co.object_id = i.object_id and co.column_id = ico.column_id where object_name(i.object_id) in ( 'Votes' , 'Users' -- , 'PostHistory' ) order by i.object_id , i.index_id , case ico.key_ordinal when 0 then 4096 else ico.key_ordinal end select * from sys.columns