• With a hell of a lot of difficulty (and a computed column). The filtered index is 2008 and above, which since this was posted in the SQL 2008 forum we assumed you were using.

    For 2005, define a computed column on ISNULL(<column that you want to be unique>,<the primary key column of the table>) and put a unique index on that computed column.

    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