title: SQL Compare Characters in two strings
body: <p>How could you compare two strings in T-SQL (SQL Server) to determine if they contain the same characters without them being in the same order.  </p>
  
  <p>For example:</p>
  
  <p>SAME</p>
  
  <pre><code>'671'
  '716'
  </code></pre>
  
  <p>SAME</p>
  
  <pre><code>'671'
  '671'
  </code></pre>
  
  <p>NOT SAME</p>
  
  <pre><code>'671'
  '731'
  </code></pre>