How do I escape double quotes in attributes in an XML String in T-SQL?

Wouldn’t that be " in xml? i.e.

"hi "mom" lol" 

**edit: ** tested; works fine:

declare @xml xml

 set @xml="<transaction><item value="hi &quot;mom&quot; lol" 
    ItemId="106"  ItemType="2"  instanceId="215923801"  dataSetId="1" /></transaction>"

select @xml.value('(//item/@value)[1]','varchar(50)')

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)