title: SQL Server compare varchar field with binary(16)
body: <p>I have 2 tables - Table A with primary key column of type binary(16) and another table B with foreign key referring to the same column but with data type as varchar(50). So table A has values like  <code>0x0007914BFFEC4603A6900045492EFA1A</code> and  table B has the same value stored as <code>0007914BFFEC4603A6900045492EFA1A</code>.</p>
  
  <p>How do i compare these 2 columns, which would give me </p>
  
  <pre><code>0007914BFFEC4603A6900045492EFA1A = 0x0007914BFFEC4603A6900045492EFA1A
  </code></pre>