title: SQL Server UNIQUE constraint with duplicate NULLs
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/767657/how-do-i-create-unique-constraint-that-also-allows-nulls-in-sql-server">How do I create unique constraint that also allows nulls in sql server</a>  </p>
  </blockquote>
  
  
  
  <p>I have a table where I need to force a column to have unique values.
  This column must be nullable and by business logic multiple NULL values should be permitted, whereas other duplicate values are not.</p>
  
  <p>SQL Server UNIQUE constraint is no good in this situation because it considers NULL as regular values, so it will reject duplicate NULLs.</p>
  
  <p>Currently, value uniqueness is granted by the BLL so I'm not looking for a dirty hack to make it work.
  I just would like to know if there is a clean solution to enforce this constraint in the DB.</p>
  
  <p>And yeah, I know I can write a trigger to do that: is a trigger the only solution? (or the best solution anyway?)</p>