When will the calculated column be updated?

I computed a column in a table called "Requirement", and the column definition calls one scalar function.

I created 10,000 statements, so when I select the 10,000 claims that the calculated column will be updated, will 10,000 rows be inserted that insert themselves into the calculated column?

Please update me

Thank you in advance

+4
source share
2 answers

It depends if the computed column is marked persisted or indexed.

If none of these conditions is true, then nothing is stored and calculated at runtime. Otherwise, it is automatically updated when the underlying data changes.

+7
source

The calculated column calculates its value when executing the SELECT command, which includes the column, assuming that the value of the calculated column is not PERSISTED .

+1
source

Source: https://habr.com/ru/post/1343954/


All Articles