• Mike Menser (9/22/2010)


    I would think it would be more taxing at the server to write a loop, or create a temp table and insert all the values and then do a gigantic replace at the end rather than just doing a nested replace. I can see where it would be tedious, but it seems to functioning well at 14 deep for me, so since I dont see any real performance drawbacks I think I will keep it. πŸ˜€

    Your call Mike, and it looks like the right one to me πŸ˜‰

    The problem posed by vevoda.ulath looks quite different. What makes it so is the requirement for multiple rows of a helper table to be involved on an operation on a single row of a target table.

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden