title: How to place unique contraint on multiple column
body: <pre><code>EmpID DeptID
  
  1     1
  1     2
  2     1
  3     2
  4     5
  5     2
  1     1   
  2     1   
  </code></pre>
  
  <p>I would like to have a constraint that will make sure that the pair of field is always unique ,such data as last two shown in the example should not be insert-able into the table .in the above table
  please note that last two rows are duplicates ,I would like to prevent such data from occuring .
  How do I achieve this in sqlserver 2005.Thanks </p>