sql - When are computed columns appropriate? -
i'm considering designing table computed column in microsoft sql server 2008. simple calculation (isnull(cola,(0)) + isnull(colb,(0))) - total. our application uses entity framework 4.
i'm not familiar computed columns i'm curious others have when appropriate used opposed other mechanisms achieve same result, such views, or computed entity column.
are there reasons why wouldn't want use computed column in table?
if use computed column, should persisted or not? i've read different performance results using persisted, not persisted, indexed , non indexed computed columns here. given computation seems simple, i'm inclined shouldn't persisted.
in experience, they're useful/appropriate when can used in other places index or check constraint, requires column persisted (physically stored in table). further details, see computed columns , creating indexes on computed columns.
Comments
Post a Comment