title: Unique constraint vs pre checking
body: <p>I use SQL Server 2008, and I have a table with a column of type varchar(X) which I want to have unique values.</p>
  
  <p>What is the best way to achieve that? Should I use unique constraint and catch an exception, or should I pre-check before inserting a new value?</p>
  
  <p>One issue, the application is used by many users so I guess that pre-checking might result in race condition, in case that two users will insert the same values.</p>
  
  <p>Thanks</p>