• Solomon Rutzky (3/4/2015)


    dwain.c (3/1/2015)


    Ah. I couldn't remember specifically what I was doing with respect to rounding. Mine was more a demonstration of the method, and I did not attempt to fine tune it to any specific "mortgage amortization" rules sheet (which I didn't know existed anyway).

    Thanks for saying it was an "excellent article" even with such discrepancies. 😀 Glad you felt like being generous today.

    Hey there. I wouldn't call my complimenting your article "generous" as that implies both a) that it really isn't, and b) that I was somehow incorrect in my assessment, neither of which are true ;-).

    Regarding "such discrepancies": had the article been titled, "How to accurately calculate a monthly amortization schedule using a recursive CTE", well, then maybe not "excellent". But the example does show an interesting use case for an rCTE which helps illustrate how those work, regardless of the accuracy of the formula used. Of course, I don't think it would be a bad idea to update the article to state clearly that the formula is for demo purposes only, knowing that enough people just copy / paste stuff and don't validate. But at the same time, people really should do their own validation. Just a thought.

    Take care,

    Solomon..

    Well thanks again.

    I wrote that article to serve two purposes:

    1. To try to get past being recursively challenged.

    2. To try to illustrate some examples of recursion in SQL without falling back upon the tired old hierarchy traversal that everybody and his brother was posting to their blogs (often copied directly from the BOL page).

    Perhaps you're right about the update, if I can ever find the time.


    My mantra: No loops! No CURSORs! No RBAR! Hoo-uh![/I]

    My thought question: Have you ever been told that your query runs too fast?

    My advice:
    INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
    The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.

    Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
    Since random numbers are too important to be left to chance, let's generate some![/url]
    Learn to understand recursive CTEs by example.[/url]
    [url url=http://www.sqlservercentral.com/articles/St