Error 1803 and model size change in SQL Server 2012
Recently I encountered error 1803 when working on SQL Server 2012. The script I ran against a SQL Server 2012 instance was
CREATE DATABASE [suspect_db] ON PRIMARY
( NAME = N'suspect_db', FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL11.SQL11_CTP3MSSQLDATAsuspect_db.mdf' , SIZE = 2048KB , FILEGROWTH = 1024KB )
LOG ON
( NAME = N'suspect_db_log', FILENAME = N'C:Program FilesMicrosoft SQL ServerMSSQL11.SQL11_CTP3MSSQLDATAsuspect_db_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO
I was confident I used this same script successfully on previous versions of SQL Server. Therefore, I examined the error message and the script properly:
Msg 1803, Level 16, State 1, Line 3
The CREATE DATABASE statement failed. The primary file must be at least 3 MB to accommodate a copy of the model database.
Then I went and compared the physical size of model and noticed that the size changed between SQL Server 2012 and previous versions. Here is a comparison of the sizes:
|
|
| ||||
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |