Troubleshooting Guide: Error 3708 – Cannot Perform Action on System Object
Why This Error Happens
Error 3708 occurs when a user or application attempts to alter, drop, or modify a system object (such as a system table, system view, or system-generated constraint) that SQL Server protects by design. This typically happens when scripts written for user databases are mistakenly run against system databases (master, model, msdb), or when automated deployment/migration tools attempt schema changes without filtering out system-owned objects. It can also surface when third-party tools incorrectly enumerate objects using sys.objects without excluding is_ms_shipped = 1 entries.
Step-by-Step Resolution Guide
Step 1: Identify the Offending Object and Context
- Capture the full error text, including the resolved
%.*lsobject name, from SQL Server Error Log or SSMS output. - Run the following query to confirm if the object is system-owned:
SELECT name, type_desc, is_ms_shipped
FROM sys.objects
WHERE name = 'YourObjectNameHere';
- If
is_ms_shipped = 1, this confirms SQL Server is correctly blocking the operation.
Step 2: Review and Correct the Script or Application Logic
- Check deployment scripts, ORM migrations (Entity Framework, Liquibase, Flyway), or DevOps pipelines for hardcoded
DROP/ALTERstatements targeting system tables. - Add explicit filtering in any dynamic SQL generation to exclude system objects:
WHERE is_ms_shipped = 0
- Verify the script is targeting the correct database context using
USE [YourDatabaseName];rather than defaulting tomaster.
Step 3: Validate Permissions and Connection String Defaults
- On Windows Server 2025/Windows 11, open SQL Server Configuration Manager and confirm the client application’s default database isn’t set to
master. - In SSMS, check Server Properties > Connections to ensure no default database override is pointing to a system database.
- If using a login with
sysadminrights, restrict it to only the necessary user database via Security > Logins > Properties > User Mapping.
Step 4: Rebuild or Restore the Affected Metadata (If Corruption Suspected)
- If the system object appears damaged (unlikely but possible after improper patching), run:
DBCC CHECKDB ('master') WITH NO_INFOMSGS, ALL_ERRORMSGS;
- If corruption is confirmed in
master, restore from a known-good backup or rebuild system databases usingsetup.exe /ACTION=REBUILDDATABASEfrom the SQL Server 2025 installation media.
Alternative or Verification Steps
- Re-run the original operation against a user-created database or test object to confirm the script logic works correctly outside system boundaries.
- If using automated tooling (SSDT, dbForge, Redgate), update to the latest build compatible with SQL Server 2025, as older filtering logic for
sys.objectsmay not account for newly shipped system objects in this version.