Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6843973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:19:09+00:00 2026-05-27T00:19:09+00:00

I have a computed column in MS SQL 2005 that does some VAT calculations.

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:19:09+00:00Added an answer on May 27, 2026 at 12:19 am

    Long story short, you can’t, because the computed column definition applies to all rows in the table. But why are you using a computed column here anyway? If (when) the VAT rate changes, the rules for applying it to goods and services change, and the number of invoices increases over time, then a computed column becomes more and more awkward as a solution.

    It would be a lot simpler and safer to calculate the VAT once, store it in a column and then just don’t update the value. You can use permissions, triggers and/or auditing to ensure that the value is not changed after being entered.

    So I would add a new, non-computed column, copy the values from the computed column and drop the computed column (see this question). Plus whatever application development you need to do to actually calculate the values in the first place, of course. It’s some extra work but since you’ve found a bug you have to fix it anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a column in my sql server 2005 table that should hold the
I have an Access form where each record has some info that is computed
I have some SQL I need to get working on SQL 2005/2008. The SQL
I have a long-running SQL Server 2005 query that I have been hoping to
How can I reuse a computed column in SQL in MySQL? Say: my query
I have a nullable DateTime column in my SQL Server 2005 table called DateTimeDeleted.
We have a few tables with persisted computed columns in SQL Server. Is there
I have a computed column created with the following line: alter table tbPedidos add
Is it possible to edit computed-column values? I have a computed-col in my table,
I have a scalar UDF that I know to be deterministic, however SQL doesn't.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.