Using system tables to identify the columns of a table index in Sybase
I came up with the following solution - thanks to the comment by Phil:
SELECT
     distinct i.name as index_name, index_col(o.name, i.indid, c.colid) as name
FROM 
    sysobjects o 
    INNER JOIN sysindexes i on i.id = o.id
    INNER JOIN syscolumns c on c.id = o.id
WHERE
    o.type = 'U'
    and o.name = 'XXXXXX'
      and i.indid &gt; 0
      and i.status &amp; 2 = 2 -- Gives only system indexes. Skip it, and get all
      and index_col(o.name, i.indid, c.colid) &lt;&gt; null
    order by 1, 2