A computed column holds values that a SQL script calculates. Give a column a script in the CC cell of a table's Columns step, and choose whether its values are calculated at query time or at insert time.
SQL Script e. g. "Some Other Column" * 100.Setting a script resets the column's foreign key (FK), its mandatory flag (M) and its Default Value.
The editor stores the script on the column; the change is saved with the table's other column changes when the step is saved, the same as every other cell in the grid.
| Type | What it means |
|---|---|
| Alias (the default) | "Calculated at query time, not stored." |
| Materialized | "Calculated at insert time, stored in the table." |
Switching the type is a change of its own: Save is enabled for it even when the script stays the same.
Empty the script and click Save: saving with an empty script clears the computed type. The Clear button empties the script and stays disabled while there is nothing saved or typed.
It is a column whose values a SQL script calculates. In a table's Columns step it sits in the CC (Computed Column) cell: click the checkbox there to open the script editor and set the script.
Alias is the default: "Calculated at query time, not stored." Materialized keeps its values in the table: "Calculated at insert time, stored in the table." You can switch the type at any time; Save stores it.
It enables only when the script or the type changed, so it stays off until you type a script or switch between Alias and Materialized.
Empty the script and click Save: saving with an empty script clears the computed type. Clear empties the script and is disabled while there is nothing saved or typed.
Setting a script resets all three on the column. How the grid treats these flags on a computed column is on The table columns grid.
The column has a script. The checkbox shows whether one is set: it is ticked when a script exists. Click it to open the editor and change the script.
Click the CC checkbox to open the editor again, change the script or the type, and click Save.
The editor's Save stores the script on the column; the column change itself is saved with the rest of the columns when you save the step, like every other column edit. See Edit a table's columns.