title: How do I eliminate the ALTER DATABASE statement from my SSDT publish script?
body: <p>Disclaimer: There is a similar <a href="https://stackoverflow.com/questions/3468486/visual-studio-2008-database-project-generating-alter-database-during-schema-comp">question</a> on SO that appears to be referring to an older version of SSDT. The selected answer references settings files that are not in my project. I believe I have the equivalent settings in the new project format set correctly.</p>
  
  <p>I'm new to SSDT, and I don't trust it yet to not change my database in unintended ways. After getting the settings the way I wanted, I tried a publish to see what it would try to do to my database. I'm getting these statements added to the publish script:</p>
  
  <pre><code>    ALTER DATABASE [$(DatabaseName)]
          SET ANSI_NULLS ON,
              ANSI_PADDING ON,
              ANSI_WARNINGS ON,
              ARITHABORT ON,
              CONCAT_NULL_YIELDS_NULL ON,
              CURSOR_DEFAULT LOCAL,
              RECOVERY FULL,
              AUTO_UPDATE_STATISTICS ON 
          WITH ROLLBACK IMMEDIATE;
  
      ALTER DATABASE [$(DatabaseName)]
          SET PAGE_VERIFY NONE 
          WITH ROLLBACK IMMEDIATE;
  
      EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
          SET TRUSTWORTHY OFF 
          WITH ROLLBACK IMMEDIATE';
  </code></pre>
  
  <p>I don't want the database project to ever modify my database settings, so I have this unchecked under Debug settings:</p>
  
  <p><img src="https://i.stack.imgur.com/q6bdr.png" alt="Deploy database properties check box"></p>
  
  <p>Also, here under advanced publish settings:</p>
  
  <p><img src="https://i.stack.imgur.com/HjUoT.png" alt="Advanced publish settings screenshot"></p>
  
  <p>Under Project Settings | Database Settings I made everything match my database:</p>
  
  <p><img src="https://i.stack.imgur.com/lCWjo.png" alt="Database settings screenshot">
  <img src="https://i.stack.imgur.com/IiuLP.png" alt="Database settings from Management Studio"></p>
  
  <p>How can I prevent this?</p>