Search code examples
sqlenvironment-variablessybaseindexing

Finding Indexes For A Table in Sybase


I am currently working in an environment where I am made double blind.

  1. I have to email any queries I need to run to a employee of the client
  2. That employee runs them in a SAS client, with an odbc connection to SyBase

I need to find out how to ascertain exactly what indexes exist on a specific table. I would use sp_helpindex, but apparently it doesn't exist on their instance of SyBase.

We believe that it is SyBase 12, but again I can't be certain of anything.

Does anyone have SQL for...
- Confirming exactly what version of SyBase we're working on?
- The details of all indexes that exist for a given table?


Solution

  • To "Confirming exactly what version of SyBase we're working on?"

    Why not use:

    select @@version


    Sybase website is down (at least here), but it would be something like:

    IQ SHOW INDEXSET INDEXES
    

    or

    IQ SHOW INDEXSET FOR indexset
    

    where indexset is tablename because every table has a indexset assigned with the same name.

    If you have access to sybase website possibly you can go further :)