Msg 1803, Level 16, State 1, Line 1
The CREATE DATABASE statement failed. The primary file must be at least %d MB to accommodate a copy of the model database.
This error message appears when you try to create a database, but the data file is not sufficiently sized to accomodate a copy of the model database.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. The data file must be a least the size of the model data file in order for the CREATE DATABASE statement to finish successfully.
All versions of SQL Server.
IF DB_ID (N’MyExample’) > 0
DROP DATABASE MyExample;
CREATE DATABASE MyExample
( NAME = MyExample_Data,
FILENAME = ‘E:MyExample_Data.mdf’,
SIZE = 1,
MAXSIZE = 50,
FILEGROWTH = 15% )
( NAME = MyExample_Log,
FILENAME = ‘E:MyExample_Log.ldf’,
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB );
In the above example we try to create a database with a size for the data file of 1 MB. Because the model db data file is about 2 MB in size, this error is raised.
Basically SQL Server just copies the model database, wehn you create a new database. Because of this, the data file for the new database, must be at least the size of the model db data file.]]>