Msg 1759, Level 16, State 0, Line 1
Computed column ‘%.*ls’ in table ‘%.*ls’ is not allowed to be used in another computed-column definition.
This error message appears when you try to use a computed column within the definition of another computed column.
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. The statement cannot be executed this way. Computed column cannot be used within the definition of other computed columns.
All versions of SQL Server.
DECLARE @t VARCHAR(10)
IF OBJECT_ID(‘tempdb..#t’) > 0
DROP TABLE #t
CREATE TABLE #t
c1 INT PRIMARY KEY,
c2 AS c2 * 2
INSERT INTO #t SELECT 1
UNION ALL SELECT 2
SET c2 = 3
In the above example we try to use the computed column c2 within the definition of c2. This raises the error.