Wednesday, May 16, 2012

Why does SQL display an & as &?

I need some assistance, my query is below:



STUFF(
(
SELECT ',' + CountDesc
FROM Count INNER JOIN ProjectCount ON Count.Id = ProjectCount.CountId
WHERE ProjectCount.ProjectId = Project.Id ORDER BY Count.CountDesc
FOR XML PATH('')
), 1, 1, '') as [Country]


What happens is when i run this query and the Count table has an & in one of its fields, it displays the & &



Is there anyway to not let this happen?



Thanks in advance.





No comments:

Post a Comment