Home Forums SQL Server 7,2000 T-SQL What is your favorite "I didn't know that" moment in T-SQL? RE: What is your favorite "I didn't know that" moment in T-SQL?

  • My most significant "Eureka!" moment shortly after I joined SSC (more than a decade ago for that) or knew anything of a Tally/Numbers Table. It was when I first realized that a simple CROSS JOIN and a couple of ancient forumulas for constraining random numbers could be used to generate a million row test table at the drop of a hat (any hat :-D) with incredibly little effort and without any explicit loop (circa SQL Server 7). I used to call the method "set based loops" until a fellow by the name of R. Barry Young coined the phrase "pseudo cursor" for the method.

    I certainly wasn't the first to do such a thing but I knew nothing, at the time, of those others that had made a similar discovery.

    --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)