• ScottPletcher (3/4/2013)


    The discussion was on the clustered index, not unique indexes in general. A clus index key needn't be unique on its own, and sometimes that's just fine. Again, it depends on the uses of that specific table.

    The OP's question was about the unique clustered index created on an indexed view. That does have to be unique. From Books Online:

    Creating Indexed Views

    The first index created on a view must be a unique clustered index. After the unique clustered index has been created, you can create additional nonclustered indexes. The naming conventions for indexes on views are the same as for indexes on tables. The only difference is that the table name is replaced with a view name. For more information, see CREATE INDEX (Transact-SQL).

    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