title: The CREATE DATABASE statement failed. The primary file must be at least 4 MB to accommodate a copy of the model database
body: <p>I'm creating an installer using InstallShield. During this install, it first installs SQL Server 2012 express (which is successful) and the second part is where I create a new database using another .exe that handles all the deploy scripts. </p>
  
  <p>When creating the database using the installer, I receive the following error in the event viewer:</p>
  
  <blockquote>
    <p>"The CREATE DATABASE statement failed. The primary file must be at least 4 MB to accommodate a copy of the model database." </p>
  </blockquote>
  
  <p>I can fix this by going in and reducing the size of the model database to 3 and it works. However, I can't really take that path because these are supposed to be unattended installations.</p>
  
  <p>After the database is set up, but before I try to run the deploy scripts, then I can use the same create statement through SQL Management studio.  It then creates the database just fine.</p>
  
  <p>Here is the script used to create the database.</p>
  
  <pre><code>CREATE DATABASE [Database1] ON  PRIMARY ( NAME = N'Database1', FILENAME
  = N'C:\Program Files\Microsoft SQL Server\MSSQL11.INSTANCE1\MSSQL
  \DATA\Database1.mdf' , SIZE = 4096KB , FILEGROWTH = 1024KB ) LOG ON 
  ( NAME = N'Database1_log', FILENAME = N'C:\Program Files\Microsoft SQL 
  Server\MSSQL11.INSTANCE1\MSSQL\DATA\Database1_log.ldf' , 1024KB , 
  FILEGROWTH = 10%)
  </code></pre>
  
  <p>As you can see, the size is 4MB and the Model Database properties say that its size is 4MB.</p>
  
  <p><img src="https://i.stack.imgur.com/2aLqF.png" alt="Model Size Property"></p>