title: SQL string comparision using IF
body: <p>This may be a silly question, but can anyone explain why SQL returns <code>'False'</code> for</p>
  
  <pre><code>IF 'test' = ' test' -- notice leading space
   SELECT 'True'
  ELSE
   SELECT 'False'
  </code></pre>
  
  <p>but returns <code>'True'</code> for </p>
  
  <pre><code>IF 'test' = 'test ' -- notice trailing space
   SELECT 'True'
  ELSE
   SELECT 'False'
  </code></pre>
  
  <p>Edit:</p>
  
  <p>I'm using SQL Server 2008 R2</p>