Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 4
    Good use of the STUFF function to nix the leading two characters. Commented Aug 11, 2011 at 23:12
  • 4
    I like this solution best, because I can easily use it in a select list by appending 'as <label>'. I am not sure how to do this with the solution of @Ritesh. Commented Aug 2, 2013 at 8:27
  • 18
    This is better than the accepted answer because this option also handles un-escaping XML reserverd characters such as <, >, &, etc. which FOR XML PATH('') will automatically escape. Commented Apr 7, 2014 at 21:35