ALTER TABLE computed_column_definition
changes a column, constraint or column property
What changes
- Input
- table definition
- Output or change
- column or constraint definition
Syntax at a glance
column_name AS computed_column_expression [ PERSISTED [ NOT NULL ] ] [ [ CONSTRAINT constraint_name ] { PRIMARY KEY | UNIQUE } [ CLUSTERED | NONCLUSTERED ] [ WITH FILLFACTOR = fillfactor ] [ WITH ( <index_option> [, ...n ] ) ] [ ON { partition_scheme_name ( partition_column_name ) | filegroup | "default" } ] | [ FOREIGN KEY ] REFERENCES ref_table [ ( ref_column ) ] [ ON DELETE { NO ACTION | CASCADE } ] [ ON ...
Work example
A computed column expression needs a reviewed definition change.
Check determinism, precision, null handling, persistence, and any index that depends on the expression.
Check your work The calculated value matches test inputs and dependent indexes remain valid.
Open Microsoft Learn for full syntax, permissions, and details for your version.