• Jeff Moden (1/28/2013)


    My personal opinion is that if you're not going to persist a calculated column, write a derived table or view, instead. That way, no one can screw up and actually make queries that even try to use it effeciently. 😛

    Typically the overhead to materialize the computed column (cc) at run time trivial. If it is, a cc has a lot of advantages, so I suggest using it as intended.

    A derived table risks differing definitions in multiple queries.

    A view forces people to use different queries to access the data depending on whether they need a certain cc or not. If a query needs that cc added, you have to rewrite the query just because of that.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".