Home Forums SQL Server 7,2000 Administration Anyway to write VB/C#/C++ scripts in SQL 2000? Need financial calculations (IRR, NPV, etc) RE: Anyway to write VB/C#/C++ scripts in SQL 2000? Need financial calculations (IRR, NPV, etc)

  • NPV is a fairly straight-forward formula, assuming you have all your cash flow values in the same row, and you know the rate of return.

    Unfortunately IRR has no straight forward way to calculate so it involves trial & error and most methods e.g. those used by financial calculators and Excel, involve converging towards and settling on a value for IRR where the NPV is insignificantly close to 0 for it to be effectively zero. I remember doing a Finance exam years ago that provided a lookup table on the back of the paper which enabled us to get an IRR that was 'close enough'.

    I found this other friendly sparring match between Celko, dwain.c & Jeff Moden on just this topic. You wouldn't have the benefit of rCTE's so might be some effort converting it into an old SQL 2000 function or procedure: http://www.sqlservercentral.com/Forums/Topic1394442-392-1.aspx