Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index checking from SQL query

Status
Not open for further replies.

LesStockton

Programmer
Mar 29, 2005
20
US
Is there a SQL query to check to see if an index (by name) exists on a table?
I have this for SQL Server and for Oracle, and need to be able to query to see if an index exists before I try to create it. In some cases, I just need to be able to programmatically check to see if the index, by name, is there.
 
This wont work.
The SHOW INDEX command isn't something that I can send through ADO from my program. I need something that I can programmatically use to check, and in addition, the SHOW INDEX will not check for a specific index.
Now, if I can get a recordset back from the SHOW INDEX command, then I could loop through and see if the index exists. I'll try that unless someone has a better query, like going through the schema.
 
Now, if I can get a recordset back from the SHOW INDEX command, then I could loop through and see if the index exists.
my advice is, please try it, and let us know what you get

r937.com | rudy.ca
 
I'll do that. Thanx.
I probably wont get to it until Monday, but thanx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top