Hi Coskan,
Try this:
Select A.name as [Table], b.name as [Index Name]
From sysobjects a, sysindexes b
Where a.id = b.id
and indid > 0 and indid < 255 and (b.status & 64)=0
and a.xtype = 'U'
and a.name <> 'dtproperties'
order by a.name
This will give all the indexes in the database on all the user tables.
Althought MS doesn't recomend directly querying the system tables since
their structure may change in the coming releases, yet if u want to use only
for db maintenance u can use this.
See if this is useful to u.
HTH,
Ravinder
-----Original Message-----
From: Coskan Gundogar [mailto:[Email Address Removed] Wednesday, May 28, 2003 1:42 PM
To: LazyDBA.com Discussion
Subject: view indexes
is there a way to view all indexes for a table/ for a database ?
i want to get the names of all indexes for db maintenance
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page