When are computed columns appropriate?

后端 未结 6 1874
渐次进展
渐次进展 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:25

    Computed column is a business rule and it's more appropriate to implement it on the client and not in the storage. Database is for storing/retrieving data, not for business rule processing. The fact that it can do something doesn't mean you should do it that way. You too you are free to jump from tour Eiffel but it will be a bad decision :)

提交回复
热议问题