Reputation: 86735
I am currently working in an environment where I am made double blind.
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?
Upvotes: 1
Views: 27283
Reputation: 1
select * from sys.sysindexes where tname='Your Table name'
Try the above code, it worked for me.
Upvotes: 0
Reputation: 1575
For sybase version:
select @@version
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';
Upvotes: 0
Reputation: 1
Find Indexes on multiple tables, not like image indexes
select name = o.name,iname = i.name from sysindexes i, sysobjects o where o.name in ('table1','table2','table3') and i.name not like 't%' and i.indid >=1 and o.id = i.id
Upvotes: 0
Reputation: 1
You can use this query:
select i.name
from sysindexes i, sysobjects o
where o.name = 'table_name' and i.indid >=1
and o.id = i.id
Upvotes: 0
Reputation: 41
Most Sybase products have a -v command line argument to tell the version with or without the engine running.
To find the indexes on any table enter the following, where my_table
is your table's name:
select i.name
from sysindexes i, sysobjects o
where o.name = 'my_table'
and o.id = i.id
Upvotes: 3
Reputation: 66697
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 :)
Upvotes: 1