title: Visual Studio Database project: checking if SQL server login exists before creating it
body: <p>When I create a Visual Studio database project for SQL 2012 and synchronise it with an existing database (using Compare Schema), I also synchronise a SQL server login. Visual Studio generates the following script for the login:</p>
  
  <pre><code>CREATE LOGIN [my_user] WITH PASSWORD = 'somesecurepass'
  </code></pre>
  
  <p>When I try to publish the generated SQL on a server where this login exists, sqlcmd shows me an error: </p>
  
  <pre><code>The server principal my_user already exists.
  </code></pre>
  
  <p>When I look at the sql script generated by Visual Studio, I see that many objects are wrapped in IF EXISTS statements, but CREATE LOGIN is not wrapped!</p>
  
  <p>I tried to wrap it manually in the SQL script in the project, but then the project does not build and there is an error pointing to IF:</p>
  
  <pre><code>SQL70001: This statement is not recognized in this context.
  </code></pre>
  
  <p>Now how do I force Visual Studio to generate the login creation script with the IF EXISTS check and also do not lose the synchronisation abilities? </p>