title: SQL Server and implicit conversion of types
body: <p>Where does SQL Server do implicit conversion and what are the rules it follows? I.E when does it convert the left side of the equality operator over the right side?</p>
  
  <pre>Foobar
  id int not null 
  quantity int not null
  quantityTest byte not null
  date varchar(20) not null
  dateTest datetime</pre>
  
  <pre><code>SELECT id
  FROM Foobar
  WHERE quantity &gt; '3'
  
  SELECT id
  FROM foobar
  WHERE quantityTest &gt; 3
  
  Select id
  FROM foobar
  WHERE date = 20120101
  </code></pre>