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_descreturnsONLINE,SUSPECT,RECOVERY_PENDING, orOFFLINE. - Check
is_read_only— it should return0(false).
Step 2: Set Model Database to Read-Write (If Flagged Read-Only)
- If
is_read_onlyreturned1, 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.databasesquery 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 ofmodel.mdfandmodellog.ldffrom 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
modeldatabase state still showsSUSPECTorRECOVERY_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 byDBCC CHECKDB(model)to assess and repair corruption, then set it backONLINE.
Step 5: Rebuild System Databases as a Last Resort
- If
modelremains 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
modeldatabase specifically from a recent full backup usingRESTORE DATABASE model FROM DISK = 'path_to_backup.bak' WITH REPLACE;while the SQL Server instance is in single-user mode.