update only one field in a table with concatenation

  • Glad that it worked for you, Marcus, and Jeff was spot on that the easier it is for us to help you, the more likely we are to do so.

    For those playing the home game, the two lines that look like:

    FOR XML PATH('')),'& a m p ;','&'),1,3,'')

    seem to have a bit of a problem on this board. That '& a m p ;' (remove the spaces that I had to add to make it show up) turns into its symbol. My original code is as directly above (again, minus the spaces in that first string), with the XML code for an ampersand in the first string, and an actual ampersand in the second.

    Marcus, to help explain the differences between this and the former example, I had to do that Replace and the odd string you see because XML (and that's what we're using for this hack) doesn't like certain symbols (they're reserved), such as an ampersand, less than, greater than, etc., and turns an ampersand into that weird string, so I reversed that conversion with the Replace. Also, I changed the Stuff to replace the first 3 characters instead of 1, as you had spaces around the ampersand separator in your example output.

Viewing post 31 (of 30 total)

You must be logged in to reply to this topic. Login to reply