Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Index ?

Author  Topic 

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2003-06-10 : 05:18:53
Hi All,

Is there any way through I can get a list of all the Indexes in a database, applied in tables. Please help.

Thanks in Advance
Sachin Samuel


harshal_in
Aged Yak Warrior

633 Posts

Posted - 2003-06-10 : 05:56:37
quote:

Hi All,

Is there any way through I can get a list of all the Indexes in a database, applied in tables. Please help.

Thanks in Advance
Sachin Samuel






u can use sp_helpindex .
refer BOL for details.

The Judgement of the Judge is as good as the Judge.
Go to Top of Page

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2003-06-10 : 06:27:30
But friend... this will not give the list of indexes applied to the database but will return the indexes applied to the table. I have more than 200 tables in the database. So if this will be the case then I have to keep on specifying 200 times, objects to the system defined stored procedure. Please suggest

Sachin Samuel

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-06-10 : 08:08:52
Ummmmm, indexes are applied to TABLES, not DATABASES. If you mean you want a list of all the indexes on all the tables in the database, you can query the sysindexes table:

SELECT OBJECT_NAME(id) AS TableName, name AS IndexName FROM sysindexes

Also look in Books Online under the IndexProperty() function in case you need to distinguish indexes from statistics.

Go to Top of Page
   

- Advertisement -