title: SQL Server : check if table exists, otherwise create it
body: <p>I have this code I am converting from MySQL:</p>
  
  <pre><code>IF NOT EXISTS (SELECT * 
                 FROM INFORMATION_SCHEMA.TABLES 
                 WHERE TABLE_SCHEMA = 'TheSchema' 
                   AND TABLE_NAME = 'odds_soccer') 
      CREATE TABLE "odds_soccer" (...)
  </code></pre>
  
  <p>Only problem is... If I try run it twice, it will stump second time with error</p>
  
  <blockquote>
    <p>Msg 2714, Level 16, State 6, Line 1<br>
    There is already an object named 'odds_soccer' in the database.</p>
  </blockquote>
  
  <p>Since I actually found my solution at SO, I am not sure why the code is not working.</p>
  
  <p>I am currently running it as a query from Microsoft SQL Server Management Studio having selected my database.</p>