SQL Server Performance

Beginner question -pardon me...

Discussion in 'T-SQL Performance Tuning for Developers' started by cb, Mar 19, 2003.

  1. cb New Member

    What is the default order for index creation?
    If its ascending then how to create another index with descending order?

    Thanks.
  2. satya Moderator

    Ascending is default, you can specify the order as :
    CREATE NONCLUSTERED INDEX IndexName ON Tablename(ColumnName ASC, ColName2 DESC).



    _________
    Satya SKJ
  3. Argyle New Member

    Just for reference, if you have an ascending index on a single column, there is no need to create a descending index on the same column as well. SQL server can traverse the leaf index nodes in both directions already.

    Adding a descending index is mostly useful when you have composite indexes.

    /Argyle

Share This Page