• I believe that the reason you're not getting any bites on this problem is that most people don't want to work so hard trying to test your data. Please see the link in my signature below for the best way to post readily consumable data.

    Also, people like to know WHY you need to do something like this. And just saying "It's a requirement" doesn't quite get it. People like to know the business reasons for doing such things because, a lot of times, there's better ways to do things than the way you may be thinking.

    And, welcome aboard.

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