SQL Server error 4922: Objects access this column
ALTER TABLE DROP COLUMN or ALTER COLUMN failed because other objects use the column. The 5074 messages before it list them.
- Error number
4922- Severity
- 16
- Category
- Names and objects
What it means
Error 4922 is the closing message of a failed ALTER TABLE ... DROP COLUMN or ALTER COLUMN when dependencies exist. Each dependent object is reported first with error 5074. Remove or change those objects and run the ALTER TABLE again.
Common causes
- Default constraints, indexes, statistics, foreign keys or check constraints that use the column.
- Schema-bound views or functions referencing the column.
How to fix it
-
Read the 5074 messages to see each dependent object, drop or alter them, then repeat the
ALTER TABLE. -
List objects that reference the table with schema binding.
SELECT OBJECT_NAME(referencing_id) AS referencing_object FROM sys.sql_expression_dependencies WHERE referenced_id = OBJECT_ID(N'dbo.Orders');
Related errors
More names and objects errors
208Invalid object name207Invalid column name4104Multi-part identifier not bound209Ambiguous column name2812Could not find stored procedure2714There is already an object named3701Cannot drop, object not found3702Cannot drop database, currently in use
The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.
Work on SQL Server in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.