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

为君一笑 提交于 2019-11-30 15:10:43
Query against sysobjects and sysindexes:
SELECT o.name,
       i.name
  FROM sysobjects o
  JOIN sysindexes i
    ON (o.id = i.id)

Documentation on the interpretation of the sysobjects and sysindexes system tables is available on the Sybase web-site.

Load up stored procedure library from http://www.edbarlow.com/ and type in sp__helpindex

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

deepak11
SELECT Object_name(id)
FROM   sysindexes si
WHERE  indid > 0  
Abhinav

To get a complete list of indexes in Sybase ASE we can use the following query -

select si.* from sysobjects so, sysindexes si where so.id = si.id and si.indid > 0

keepin in mind that a simple select between sysobjects system table and the sysindexes table will give table names along with index names if non-clustered indexes exists. Check the following link for more information -

Sybase ASE - How to find index list in a sybase database

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

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

You may check sybase version as follows:

select @@version
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!