I am trying to update XML node and while it does not generate an error it does not update the value.
the xml
<ParameterValues>
<ParameterValue>
<Name>TO</Name>
<Value>[email protected]</Value>
</ParameterValue>
<ParameterValue>
<Name>IncludeReport</Name>
<Value>True</Value>
</ParameterValue>
<ParameterValue>
<Name>RenderFormat</Name>
<Value>MHTML</Value>
</ParameterValue>
<ParameterValue>
<Name>Subject</Name>
<Value>@ReportName was executed at @ExecutionTime</Value>
</ParameterValue>
<ParameterValue>
<Name>IncludeLink</Name>
<Value>True</Value>
</ParameterValue>
<ParameterValue>
<Name>Priority</Name>
<Value>NORMAL</Value>
</ParameterValue>
</ParameterValues>
The update string.
(This is what Im tring to change -
<Value>[email protected]</Value>)set @input.modify('replace value of (/ParameterValues/ParameterValue/Name/Value/ text())[1] with "[email protected]"')
If I change the string to update the Name node it updates with "[email protected]"?
1.<Name>TO</Name>
set @input.modify('replace value of (/ParameterValues/ParameterValue/Name/ text())[1] with "[email protected]"')
Example result
<ParameterValues>
<ParameterValue>
<Name>[email protected]</Name>
<Value>[email protected]</Value>
</ParameterValue>
setis executed in?TSQLto your question tags so experts of that field can help you instead. xP