---
title: "On-Premises Script Error - \"The Primary File...model database\""
slug: "on-premises-script-error-the-primary-filemodel-database"
updated: 2025-09-09T13:08:19Z
published: 2025-09-09T13:08:19Z
canonical: "support.controlup.com/on-premises-script-error-the-primary-filemodel-database"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.controlup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# On-Premises Script Error - "The Primary File...model database"

### Issue

Error message: `"The primary file must be at least X MB to accommodate a copy of the model database" `

### Root Cause

When the database is created it uses the model DB as a template, the model DB is a built-in system database in SQL.

When the On-premises database is created with the creation script, the following SQL statement sets the database size to 50 MB.

```
DECLARE @dbDataFileSize VARCHAR(10) = 50
```

![SQL statement showing the database size is 50 MB](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/1150020153852017-02-231417.png)

### Resolution

Open SQL Server Management Studio, right-click the model DB, go to **Properties** -> **Files** and check the initial size (MB): ![Files popup](https://cdn.document360.io/098100b7-b9da-4bea-b4b9-017140ab863e/Images/Documentation/115001850065Model-DB-SS.JPG)

Edit the SQL script that the On-Premises wizard created, line 30, and change the value from 50. In this example, you see that the initial size is 128MB. Change it to 129MB to resolve the problem.
