Troubleshooting Guide: SQL Server Error 10915 — “Altering ‘%.*ls’ %S_MSG is not allowed”
Why This Error Happens
Error 10915 occurs when an ALTER TABLE or ALTER COLUMN statement attempts to modify an object in a way that conflicts with SQL Server’s internal metadata constraints, such as changing a column that is referenced by a computed column, index, statistics, or replication schema. This often happens because the target object has dependencies (foreign keys, indexed views, full-text indexes, or in-memory OLTP constructs) that lock certain properties from being altered directly. It can also surface when attempting to modify system-versioned temporal tables or memory-optimized tables without first disabling the feature that restricts the change.
Step-by-Step Resolution Guide
Step 1: Identify the Blocking Dependency
- Run
sp_depends 'YourTableName'or querysys.sql_expression_dependenciesto list objects referencing the table/column you are trying to alter. - Check if the column is part of a computed column, check constraint, or indexed view definition.
- Look for memory-optimized table flags by running
SELECT is_memory_optimized FROM sys.tables WHERE name = 'YourTableName';.
Step 2: Drop or Disable Conflicting Constraints/Indexes
- If the column is used in a non-clustered index or statistics object, drop it temporarily using
DROP INDEX IX_Name ON dbo.YourTableName;. - For system-versioned temporal tables, disable versioning first:
ALTER TABLE dbo.YourTableName SET (SYSTEM_VERSIONING = OFF);. - For memory-optimized (In-Memory OLTP) tables, note that many ALTER operations are restricted in SQL Server 2025; you may need to export data, drop, and recreate the table with the new schema instead.
Step 3: Modify the Schema Using a Safe Workaround
- Create a new table with the desired schema:
CREATE TABLE dbo.YourTableName_New (...);. - Migrate data using
INSERT INTO dbo.YourTableName_New SELECT * FROM dbo.YourTableName;. - Rename objects using
sp_renameto swap the old table out and the new table in, minimizing downtime.
Step 4: Re-enable Constraints and Validate Permissions
- Re-create any dropped indexes, constraints, or system-versioning settings removed in Step 2.
- Confirm your login has
ALTERpermission on the schema by runningSELECT * FROM fn_my_permissions('dbo.YourTableName', 'OBJECT');. - On Windows Server 2025, ensure the SQL Server service account has not been restricted by newly hardened Group Policy settings affecting local file/database permissions.
Alternative or Verification Steps
- Re-run the original
ALTER TABLEorALTER COLUMNstatement in SQL Server Management Studio (SSMS) and confirm it completes without Error 10915. - If the error persists, use
DBCC CHECKTABLE('YourTableName')to rule out corruption, and review the SQL Server Error Log (viaEXEC sp_readerrorlog) for additional context tied to the same timestamp.