• ahmed7.bi (12/12/2010)


    i have read that only one unique clustered index can be created on a table and many non clustered index

    then how come the below commands works fine as it is creating a unique clustered index on 2 columns of a table

    You can only have one clustered index per table, though it doesn't have to be unique. Your command works because it's only creating one clustered index that consists of two columns. If you tried to create two single column clustered indexes, the second create index would fail.

    For info on clustered index, have a read over this: http://www.sqlservercentral.com/articles/Indexing/68563/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass