June 3, 2010 at 8:26 am
the devil is in the details, but here's my two cents:
use computed columns or a view which does the computation for you whenever possible.
i don't know if you've ever tried it, but storing a formula in a field, and then trying to execute the value of the field to get the results is a real pain in the... whatever.
try it with a simple example...
declare @MyCalculation varchar(30)
SET @MyCalculation ='SELECT 1 + 2+ 3'
EXEC (@MyCalculation)
--or worse COLUMNA + COLUMNB
see if you can get the results back...it's a pain.
Lowell
June 3, 2010 at 8:34 am
Thanks Lowell, I'll start working on using computed columns.
If anyone else pictures an even better way when reading this post, please share your ideas 🙂
June 3, 2010 at 2:45 pm
As Yogi Bera used to say, "When you come to a fork in the road, take it.". If you can suscessfully create a computed column, try to make it a "persisted" computed column.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply