• Luis Cazares (2/6/2014)


    There's a simple reason of why would I do this on the front end. Formatting totals and subtotals is a lot simpler that way.

    If the front-end code has capabilities similar to the Matrix capabilites of SSRS, I'd agree. But even then, it's good to know how to do these types of things in T-SQL because a front end doesn't always have the capability to do it easily and, sometimes, there is no front end to be had.

    It's also a heck of a lot easier to deploy and maintain than managed code.

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