When are computed columns appropriate?

后端 未结 6 1871
渐次进展
渐次进展 2021-02-04 12:54

I\'m considering designing a table with a computed column in Microsoft SQL Server 2008. It would be a simple calculation like (ISNULL(colA,(0)) + ISNULL(colB,(0))) - like a tot

6条回答
  •  [愿得一人]
    2021-02-04 13:38

    In my experience, they're most useful/appropriate when they can be used in other places like an index or a check constraint, which sometimes requires that the column be persisted (physically stored in the table). For further details, see Computed Columns and Creating Indexes on Computed Columns.

提交回复
热议问题