• Nice.  the difference in time is more pronounced at 40k rows than 20k, although if you keep going up the time to create the delimited string becomes too unbearable to test.

    Question: assuming that the delimited string is coming from the outside (so you don't have to worry about the time to create it), will there be a point at which the performance of the REPLACE() function becomes unbearable also?

    Small thing: You probably need to change your name for the XML proc in the code sample and also your test code, which does this:

    print     @CSV

    exec usp_LoopVersion       @CSV

    exec usp_LoopVersion   @CSV

    Thanks,

    >L<