I have the below code which errors when I run it because it has the "&" sign and can not convert it.
the result should display "testing &". however if I change the xml bit to "testing &" it works. I need a way to replace it so that it does not error.
Declare @Request XML = null
If @Request IS NULL
BEGIN
SET @Request = '
<Request>
<ProductRequest>
<ProductName>testing &</ProductName>
</ProductRequest>
</Request>'
END
select @Request.value ('(//ProductName)[1]','nvarchar(100)')