How can I find a list of Sybase indexes for a given database?

How can I find a list of indexes for a given database in Sybase?

+5
source share
4 answers
Query against sysobjects and sysindexes:
SELECT o.name,
       i.name
  FROM sysobjects o
  JOIN sysindexes i
    ON (o.id = i.id)

Documentation for interpreting sysobjects and sysindexes system tables is available on the Sybase website.

Download the stored procedure library from http://www.edbarlow.com/ and enter sp__helpindex

or use the provided Sybase sp_helpindex, which expects the table name as a parameter.

+7
source
SELECT Object_name(id)
FROM   sysindexes si
WHERE  indid > 0  
+2
source

Sybase ASE, -

. * sysobjects so, sysindexes si, so.id = si.id si.indid > 0

remember that a simple choice between the sysobjects system table and the sysindexes table will give the table names along with the index names if non-clustered indexes exist. Check out the following link for more information -

Sybase ASE - How to find index list in sybase database

+1
source

In Sybase SAP IQ / 16, you can get a list of indexes with the following (table name my_table is case sensitive):

select *
from sys.sysindexes
where tname = 'my_table';

You can check the sybase version as follows:

select @@version
0
source

All Articles