• Beware that this is an unsupported feature from MS.

    The results may be much different if you use a complex query to get the string. Happened to me once and it's a pain to debug.

    A workaround is to use a temp table to place the data with the complex query and get the results from there using a simple query. Anything to get rid of cursors!