Search code examples
indexingisql

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


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


Solution

  • 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.