Subject How to test for the presence of an index?
Author Adrian Wreyford
I need some advice on how to test for the presence of an index, before
running a script to update a database to a newer structure.



The reason I have to do this, is that I made a prior error on releasing my
software, so there are two versions out in the field.

The one allready has a unique indiex on a filed in a table, and the other
not.



Now when I run a script to update the table structures, it works fine on
those without the index, but obviously fails on those with the index, as it
allready exists.



I thus need to test for the presence of the index before attempting to run
the script, and will thus have to branch my code to run script A - without
index, and script B - with index.



Thanks in advance



Adrian

PS can this be done from within a script?



[Non-text portions of this message have been removed]