Error 1803 and model size change in SQL Server 2012
Published Jan 15 2019 02:07 PM 551 Views
Microsoft
First published on MSDN on Oct 29, 2011

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:

SQL Server version

Physical file size (bytes)

sp_spaceused information

model.mdf

modellog.ldf

reserved

data

index_size

unused

2000

655,360

524,288

528 KB

144 KB

280 KB

104 KB

2005

1,245,184

524,288

1136 KB

472 KB

560 KB

104 KB

2008

1,310,720

524,288

1200 KB

472 KB

624 KB

104 KB

2008 R2

1,310,720

524,288

1216 KB

512 KB

632 KB

72 KB

2012

2,162,688

524,288

2096 KB

792 KB

1080 KB


Version history
Last update:
‎Jan 15 2019 02:08 PM
Updated by: