title: Unique constraint on two fields, and their opposite
body: <p>I have a data structure, where I have to store pairs of elements. Each pair has exactly 2 values in it, so we are employing a table, with the fields(leftvalue, rightvalue....).
  These pairs should be unique, and they are considered the same, if the keys are changed.</p>
  
  <pre><code>Example: (Fruit, Apple) is the same as (Apple, Fruit).
  </code></pre>
  
  <p>If it is possible in an efficient way, I would put a database constraint on the fields, but not at any cost - performance is more important.</p>
  
  <p>We are using <code>MSSQL server 2008</code> currently, but an update is possible.</p>
  
  <p>Is there an efficient way of achieving this?</p>