• JJ B (1/31/2011)


    Believe it or not, this kind of thing can have a production purpose. I have to send "narrative" from our database to a database in another agency. The other agency set their narrative column to have a max of X characters even though the actual data would be much bigger than X. (Don't ask why.) When they display the narrative to the user on their web application, they string the text from multiple rows together. When the narrative is saved to the database, they break it back up into X chunks/rows.

    So, when I send the agency our data, I have to break it into chunks of size X. It doesn't mater where the break is, and it doesn't even matter if there is an extra row at the end. So, this kind of technique could work great for my production purpose. (Note: I don't currently use a loop. I also don't use this spackle method. I will do some research first, but I will likely switch methods in the future.)

    Very cool feedback, JJ B. If you're not currently using a loop or the method in the article, what are you using?

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