Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    UK
    Posts
    26

    Unanswered: Index definition - can you get it?

    It is possible to get the definition of an index in a script?
    I want the "Create index..." string so I can drop and recreate the index in a single statement.
    You can do it in the Query Analyzer object browzer with the "Script object..." options.
    Last edited by jagnini; 05-19-04 at 07:10.

  2. #2
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    Quote Originally Posted by jagnini
    It is possible to get the definition of an index in a script?
    I want the "Create index..." string so I can drop and recreate the index in a single statement.
    You can do it in the Query Analyzer object browzer with the "Script object..." options.
    when u script a table the script for the index is also created.

  3. #3
    Join Date
    Mar 2004
    Location
    UK
    Posts
    26

    Thumbs up See "Change database collation - quickly" thread

    You can get all the indexes on a table from sysindexes.
    You can get all the index's properties with INDEXPROPERTY ( table_ID , index , property ).
    You can get all the columns involved in an index with INDEX_COL.

    See the "Change database collation - quickly" thread where the sql is built up that will create the index.

Posting Permissions

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