CREATE TABLE ... computed column
defines a derived column (virtual or PERSISTED)
What changes
- Input
- other columns of the same row
- Output or change
- computed column definition
Syntax at a glance
column_name AS computed_column_expression [ PERSISTED [ NOT NULL ] ]
Work example
A table needs a derived column that repeats the same expression for every reader.
Check determinism, precision, null behavior, and whether persistence is required by the target workload.
Check your work The computed value matches the expression for boundary and NULL inputs.
Open Microsoft Learn for full syntax, permissions, and details for your version.