Why This Error Happens
Error 4928 occurs when SQL Server 2025 blocks an ALTER TABLE...ALTER COLUMN operation because the target column is governed by a dependent object or special attribute, such as a computed column definition, a CHECK/DEFAULT constraint, a unique/primary key index, or a replication/CDC tracking flag. SQL Server intentionally refuses the in-place schema change to prevent breaking referential integrity or the internal metadata used by dependent features. This is not a corruption issue but a dependency-ordering restriction enforced by the Storage Engine’s DDL validation layer.
Step-by-Step Resolution Guide
Step 1: Identify the Exact Dependency Blocking the Change
- Run the following query to see what the error message substituted for
%ls(e.g., “COMPUTED”, “REPLICATED”, “IDENTITY”, “the ROWGUIDCOL”):
SELECT name, is_computed, is_identity, is_replicated, is_rowguidcol
FROM sys.columns
WHERE object_id = OBJECT_ID('YourSchema.YourTable') AND name = 'YourColumn';
- Cross-reference
sys.check_constraints,sys.default_constraints, andsys.indexesfor the sameobject_idto confirm which object is tied to the column.
Step 2: Drop the Dependent Object Before Altering
- If a CHECK or DEFAULT constraint is attached, drop it first:
ALTER TABLE YourSchema.YourTable DROP CONSTRAINT DF_YourTable_YourColumn;
- If the column is part of an index (including a unique constraint or primary key), drop the index:
DROP INDEX IX_YourTable_YourColumn ON YourSchema.YourTable;
- If the column is
COMPUTED, you cannot alter it directly — you must drop and recreate the computed column definition instead:
ALTER TABLE YourSchema.YourTable DROP COLUMN YourColumn;
ALTER TABLE YourSchema.YourTable ADD YourColumn AS (NewExpression);
Step 3: Perform the Column Alteration
- With dependencies removed, run the intended change:
ALTER TABLE YourSchema.YourTable ALTER COLUMN YourColumn NVARCHAR(100) NULL;
- If the column participates in replication or Change Data Capture (CDC), pause the publication/capture job via SQL Server Management Studio (SSMS) > Replication > Local Publications before altering, then resume afterward.
Step 4: Recreate Dropped Constraints/Indexes
- Re-add any CHECK, DEFAULT, or INDEX objects removed in Step 2 using their original definitions (retrieve them beforehand via
sp_helpconstraint 'YourTable'or SSMS’s “Script Table as > CREATE To” feature) so you don’t lose data validation rules.
Alternative or Verification Steps
- Confirm the fix by re-running the original
ALTER TABLEstatement; it should complete without Error 4928, andsys.columnsshould reflect the new data type/nullability. - If the column is tied to system-versioned temporal tables or memory-optimized tables (common in SQL Server 2025 workloads), disable system versioning (
SET (SYSTEM_VERSIONING = OFF)) or drop/recreate the memory-optimized table via a new schema version, then re-enable versioning after the alteration completes.