• Sean Lange (3/19/2013)


    Why not just look at the excellent code that Chris M posted earlier in one of the dozen or so threads on the same topic.

    http://www.sqlservercentral.com/Forums/Topic1432131-391-1.aspx#bm1432134

    Why not, indeed. Thanks, Sean. You saved me a bit o' work here.

    @kapil_kk,

    I read some of your replies on the thread that Sean posted a link to above. It would appear that you might want to learn the setbased way for this but you just don't understand it. Let me know if you want a short lesson on this so you can do such things on your own in the future.

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