• ChrisM@Work (6/27/2012)


    This technique isn't exactly new though. I can remember the first time I posted a solution using it, possibly as long as a couple of years ago. However, if you feel it's worthwhile (a few recent posts suggests it might be), then I'll go for it.

    Consider what happened with the Tally Table. It was actually a technique that some folks used on main frames way back when. Since then, it's been written about dozens if not hundreds of times and who knows how many thousands of posts there were on the subject before I wrote about it. I wrote about it because, despite the number of times it had been written about and posted, people weren't getting how it worked.

    Now, consider that I hadn't even considered using the output of one CROSS APPLY in another in the same query. How many other folks may be missing that epiphany?

    Start the introduction of the article with something like "Yeah... I know this is an old trick but, judging from the number of posts that could actually benefit from it, I thought I'd write about it so that even a Neophyte to SQL can understand it well enough to take advantage of the power and simplicity-of-code the technique offers."

    It would make a great "Spackle" article.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)