title: How do I compare two columns for equality in SQL Server?
body: <p>I have two columns that are joined together on certain criteria, but I would also like to check if two other columns are identical and then return a bit field if they are.</p>
  
  <p>Is there a simpler solution than using CASE WHEN?</p>
  
  <p>Ideally I could just use:</p>
  
  <pre><code>    SELECT Column1 = Column2 AS MyDesiredResult
        FROM Table1
  INNER JOIN Table2 ON Table1.PrimaryKey = Table2.ForeignKey
  </code></pre>