title: SQL if statement syntax error
body: <p>I've been trying to write this simple mysql statement to check if a table exists:</p>
  
  <pre><code>IF object_id('carpool'.'users', 'U') is not null THEN
      PRINT 'Present!'
  ELSE
      PRINT 'Not accounted for'
  END IF
  </code></pre>
  
  <p>'carpool' is my schema and 'users' is a table
  My sql version is 5.1.52-community
  I keep getting this error: </p>
  
  <pre><code>Error Code: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF' at line 1   0.000 sec
  </code></pre>
  
  <p>I've tried several syntaxes such as IF BEGIN END ELSE BEGIN END to no avail.
  any ideas?</p>