title: Using Logic in TSQL
body: <p>I want to do something like this in TSQL (SQL Server 2005):</p>
  
  <pre><code>IF (Column1 = x)
  {
       --CTE statement
  }
  ELSE
  {
      --SQL statement
  }
  </code></pre>
  
  <p>Any help is appreciated.</p>