Msg 4924, Level 16, State 1, Line 1
%ls failed because column ‘%.*ls’ does not exist in table ‘%.*ls’.
This error message appears when you try to drop a column via ALTER TABLE DROP COLUMN from a table, that does not exist in this table.
The T-SQL statement can be parsed, but causes the error at runtime.
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. You can only drop columns from a table that do exist in that table.
All versions of SQL Server.
IF OBJECT_ID(‘tempdb..#t’) > 0
DROP TABLE #t
CREATE TABLE #t
id INT PRIMARY KEY
ALTER TABLE #t DROP COLUMN c1
In the above example we try to drop the non-existing column c1 from the table #t. This raises the error.