An encoding issue with “FOR XML PATH”:
DECLARE @str NVARCHAR(MAX)= N'h&s_dor, Zoe&lee88AB'
select stuff(( select ',' + t.Alias from split ( @str, ',') t
FOR XML PATH(''))
,1,1,'') EncStr
Solution:
FOR XML PATH(''), TYPE).value('.','NVARCHAR(max)')
select stuff((( select ',' + t.Alias from split ( @str, ',') t
FOR XML PATH(''), TYPE).value('.','NVARCHAR(max) '))
,1,1,'') EncStr
No comments:
Post a Comment