I have to deal with a quite badly designed table on a regular basis. The table stores money amounts as varchar. I also often need to get the value of one column minus another. So I have to type this out every time…
cast(total_bet_amount as money)-cast(refund_amount as money) as handle.
It can get quite tedius if I need to get some info quickly.
So I thought about adding a computer column with the above calculation.
I am guessing the value is never stored? So it shouldn’t increase the size of the table too much?
The table is about 5.7gb in size and contains about 21 million rows.
got the answer to the second question using stack overflow. (used an alter table query to add the new computed column)
But thanks for answering the first question. It should be much easier to use the db from now on. no more having to write out a long lines to get figures, and no more excel mangling my dates.