code_junkie

How to preserve an ampersand (&) while using FOR XML PATH on SQL 2005

Nov 12th, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. SELECT 'http://foosite.com/' + RTRIM(li.imageStore)
  2. + '/ImageStore.dll?id=' + RTRIM(li.imageID)
  3. + '&raw=1&rev=' + RTRIM(li.imageVersion) AS imageUrl
  4. FROM ListingImages li
  5. FOR XML PATH ('image'), ROOT ('images'), TYPE
  6.  
  7. <images>
  8. <image>
  9. <imageUrl>http://foosite.com/pics4/ImageStore.dll?id=7E92BA08829F6847&raw=1&rev=0</imageUrl>
  10. </image>
  11. </images>
  12.  
  13. <images>
  14. <image>
  15. <imageUrl>http://foosite.com/pics4/ImageStore.dll?id=7E92BA08829F6847&raw=1&rev=0</imageUrl>
  16. </image>
  17. </images>
Add Comment
Please, Sign In to add comment