• Matt Whitfield (11/16/2009)


    in your function, you know you are replacing with something that will eventually disappear. However, you could easily want to replace one space with two spaces in another scenario, and if REPLACE did that sort of looping internally, then it would never return, because it would never run out of things to replace.

    ?

    Why would we want replace one space with 2 spaces when cleaning up text?

    Your example code replaces one space with one space? REPLACE(expression, ' ', ' ') ?

    I don't think fn_CleanUp has these issues.