assuming the table below as instance:
DESCRIPTION DEBIT CREDIT BALANCE
check cashed 0 500 12050
rent 1000 0 11050
check cashed 0 120 11170
After insert all those values, let's say I need to change the first credit, from 500 to 600. Once I do that, all the next records must be recalculated. I don't need just to get the total balance, but it should be calculated row by row, to update all the next rows.
I thought I could do getting all the values in a gridview and than calculate. But it's a too slow way. I thought in T-SQL or even do without bind a grid to calculate.
What's the best way to do that?