The Primary File Must Be At Least 100 MB To Accommodate A Copy Of The Model Data

IT Support Forum Forums Databases Microsoft SQL Server 2008 R2 SQL Queries The Primary File Must Be At Least 100 MB To Accommodate A Copy Of The Model Data

This topic contains 0 replies, has 1 voice, and was last updated by  Webmaster 1 year, 7 months ago.

  • Author
    Posts
  • #1139

    Webmaster
    Keymaster

    When running a CREATE DATABASE statement, you get this error:

    The primary file must be at least 100 MB to accommodate a copy of the Model database

    To fix the Primary file must be at least 100 MB, connect to the database instance with SQL Management Studio, expand System Databases, right click the Model database, click Shrink -> Database and follow the wizard.

    After this you should be able to run the CREATE DATABASE statement without it complaining that it can’t copy the Model database.

    Why does SQL complain about the Model database when you run the CREATE DATABASE statement? Because SQL uses the Model database (which is a system database) to make a copy of it to create the new database. If the primary file is more than 100 MB, it assumes that there’s stuff in the model DB and it’s not a good blank database to make a copy of. Shrinking the database fixes this.

You must be logged in to reply to this topic.