Msg 4406, Level 16, State 1, Line 1
Update or insert of view or function ‘%.*ls’ failed because it contains a derived or constant field.
This error message appears when you try to insert or update through a view or a function that contains a derived or constant field.
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 cannot insert or update a view or a function that contains a derived or constant field.
All versions of SQL Server.
IF OBJECT_ID (‘dbo.T’) IS NOT NULL
DROP TABLE dbo.T;
IF OBJECT_ID (‘dbo.V’) IS NOT NULL
DROP VIEW dbo.V;
CREATE TABLE dbo.T
CREATE VIEW dbo.V
c1 = 1;
In the above example we try to update the view dbo.V. Because this view contains the constant expression 1, the error is raised.