Can I prevent a computed column from changing it's value if the formula changes?

Posted by William Hurst on Stack Overflow See other posts from Stack Overflow or by William Hurst
Published on 2011-11-21T16:04:11Z Indexed on 2012/09/20 9:38 UTC
Read the original article Hit count: 171

Filed under:

I have a computed column in MS SQL 2005 that does some VAT calculations. The website uses invoices that can only be generated once and rely on the value in the computed column to work out the VAT.

Unfortunately, a bug was found that means that the the VAT value calculated was off by a few cents. Not a huge problem but we can't change the values from all the previously computed values as these need to be honoured on the invoices.

tldr; How do I change the calculation for a computed column without re-calculating the values that have already be calculated?

© Stack Overflow or respective owner

Related posts about sql-server