// SQL Server error reference

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
Error message
%ls %.*ls failed because one or more objects access this %S_MSG.

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

  1. Read the 5074 messages to see each dependent object, drop or alter them, then repeat the ALTER TABLE.

  2. 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

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.

// fewer errors, faster fixes

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.