System databases master, model, msdb, and tempdb cannot be detached.

Error Message:
Msg 7940, Level 16, State 1, Line 1
System databases master, model, msdb, and tempdb cannot be detached.

Severity level:
16.

Description:
This error message appears when you try to detach one of SQL Server own system databases.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Error of the Severity level 16 are generated by the user and can be fixed by the SQL Server user. You cannot detach the system databases.

Versions:
All versions of SQL Server.

Example(s):
USE master
EXEC sp_detach_db ‘TempDB’

Remarks:

]]>

Leave a comment

Your email address will not be published.