Results 1 to 5 of 5

Thread: how to find if index key is ASC or DESC from system tables?

  1. #1
    Join Date
    Apr 2003
    Posts
    4

    how to find if index key is ASC or DESC from system tables?

    There is a index: CustomerInfo_1
    with keys: customerId, EnteryDate DESC
    I could not find where the order of index key (i.e. whether the key is ascending or descending) is stored?
    I tried system tables such as sysindexes and sysindexkeys tables. But could not find it.
    Any help in this regard will be truly appreciated.

    Thank you.
    Regards,
    Anuj Goyal

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    You can find it in em -> design table.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    SELECT indexkey_property(OBJECT_ID('tablename'),2,1,'IsDe scending')

    Look in BOL for indexkey_property

  4. #4
    Join Date
    Sep 2002
    Location
    Montreal
    Posts
    86
    Hi, here is the function you can use to determine the order of an Index key (index column):

    SELECT indexkey_property(OBJECT_ID('authors'),2,2,'IsDesc ending')

    check BOL for the function usage details.

    Dim

  5. #5
    Join Date
    Sep 2002
    Location
    Montreal
    Posts
    86
    .... didn't refresh my screen before submit the answer, so MAK already answered it.

Posting Permissions

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