Results 1 to 3 of 3

Thread: Index exists ?

  1. #1
    Join Date
    Dec 2005

    Unanswered: Index exists ?

    Is there a select statement to determine if an index exists by a particular name?
    I know I can check columns by doing:

    Select * from Information_Schema.COLUMNS where COLUMN_NAME='fieldname'

    but I'm not sure how to do the same for checking for an index by name.

  2. #2
    Join Date
    Aug 2004
    San Antonio, TX
    No there isn't. In reference to your other thread asking the same question regarding an existance check for a table, there isn't one for that either. Tables and indexes are part of your database design. Checking to see if they exist doesn't make any sense.

  3. #3
    Join Date
    Dec 2005
    Well, I guess that I'm the only one in the world that has ever wanted to do this. Pardon me for not making any sense.

    I guess the existence of these forums doesn't make any sense either if you're not allowed to ask a question where one self appointed expert decides that if he doesn't want to do something, then no one else should want to either.

    Had it occurred to you that if you're running an application, the application doesn't know the layout of databases on the server, and that it might need to query them to tell what's there, so that it knows if it needs to create something in order to do it's job?

    And I don't believe, with all due respect, that it's reasonable to just put in the commands to create a particular database, and then trap for a failure.

    Other database systems provide better functionality.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts