Link to home
Start Free TrialLog in
Avatar of yanci1179
yanci1179

asked on

Find Indexes

Is there a way to get a list of all indexes in all tables.  Also identify if they are non-clustered or clustered.  Using SQL 2005?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
select
  quotename(schema_name(o.schema_id)) + '.' + quotename(o.name) as [object],
  i.name as [index],
  i.type_desc as [index type]
from sys.indexes i
inner join sys.objects o
on i.[object_id] = o.[object_id]
where i.name is not null
order by [object], i.index_id
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial