How to fix Error 1810 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 1810 — “The model database must be updatable”

Why This Error Happens

This error occurs when SQL Server attempts to create a new database by copying the model system database, but the model database is either set to read-only, is in a suspect, offline, or restoring state, or its database files are missing, corrupted, or locked by another process. Since every new database inherits its initial configuration and structure directly from model, SQL Server cannot proceed if that source database is not in a fully writable, healthy, online state. This is commonly caused by improper shutdowns, disk corruption, manual file permission changes, or an interrupted restore operation targeting model.

Step-by-Step Resolution Guide

Step 1: Check the Current State of the Model Database

  • Open SQL Server Management Studio (SSMS) or a query window and run:
  SELECT name, state_desc, is_read_only FROM sys.databases WHERE name = 'model';
  • Confirm whether state_desc returns ONLINE, SUSPECT, RECOVERY_PENDING, or OFFLINE.
  • Check is_read_only — it should return 0 (false).

Step 2: Set Model Database to Read-Write (If Flagged Read-Only)

  • If is_read_only returned 1, run the following command:
  ALTER DATABASE model SET READ_WRITE WITH ROLLBACK IMMEDIATE;
  • Verify no active connections are blocking the change via sp_who2.
  • Re-run the sys.databases query from Step 1 to confirm the state updated successfully.

Step 3: Verify File Integrity and Permissions on Model Database Files

  • Locate the physical files, typically found at:
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\model.mdf
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\modellog.ldf
  • Right-click each file, go to Properties > Security, and confirm the NT SERVICE\MSSQLSERVER (or your named instance service account) has Full Control.
  • If files are missing or flagged as corrupted, stop the SQL Server service via services.msc, restore clean copies of model.mdf and modellog.ldf from a known good backup or installation media, and restart the service.

Step 4: Restart SQL Server in Single-User or Minimal Configuration Mode (If Still Suspect)

  • If the model database state still shows SUSPECT or RECOVERY_PENDING, stop the SQL Server service.
  • Restart the instance using the -f (minimal configuration) startup parameter via SQL Server Configuration Manager under Service Properties > Startup Parameters.
  • Once connected, attempt to run ALTER DATABASE model SET EMERGENCY; followed by DBCC CHECKDB(model) to assess and repair corruption, then set it back ONLINE.

Step 5: Rebuild System Databases as a Last Resort

  • If model remains corrupted beyond repair, run SQL Server Setup from the installation media.
  • Choose Advanced > Rebuild Database and follow the wizard to restore all system databases, including model, to their default state.
  • Reapply any custom configurations previously set in model (default collation, auto-growth settings, etc.) after the rebuild completes.

Alternative or Verification Steps

  • Confirm the fix by creating a new test database using CREATE DATABASE TestDB01; — if it completes without Error 1810, the issue is resolved.
  • As an alternative, if rebuilding system databases is not desirable, restore the model database specifically from a recent full backup using RESTORE DATABASE model FROM DISK = 'path_to_backup.bak' WITH REPLACE; while the SQL Server instance is in single-user mode.