Msg 271, Level 16, State 1, Line 13
The column “%.*ls” cannot be modified because it is either a computed column or is the result of a UNION operator.
This error message appears when during an UPDATE operation either the value for a computed column in a base table should be modified or this column the result of a statement is, that uses the UNION operator.
The T-SQL statement can be parsed, but causes the error at runtime.
Error of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. You must modify the UPDATE statement to not try to modifiy the computed column. Resp. the UNION statement must be modified.
All versions of SQL Server
CREATE TABLE #t
, c2 INT
, c3 AS c1 * c2
INSERT INTO #t SELECT 1, 2
UNION ALL SELECT 2, 4
SET c3 = 1
WHERE c1 = 1
DROP TABLE #t
The above example tries to update the value of a computed column. Because this is an illegal operation, the error is raised.