• GilaMonster (12/23/2012)


    Dynamic SQL (watch for SQL injection) or a string splitter function. I recommend the latter. Search this site for 'Delimited8kSplit'

    Here's the link for the DelimitedSplit8K splitter.

    http://www.sqlservercentral.com/articles/Tally+Table/72993/

    If you need something more sophisticated or need to handle something longer than 8K bytes, I strongly recommend a CLR.

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