I'm trying to insert a new XML element in my XML data type, but this new XML element must contain the value of another XML element. For example, given the following XML:
<Config>
<SomeOtherNode>
<ValueToUse>123</ValueToUse>
</SomeOtherNode>
</Config>
should render the following:
<Config>
<Node1>123</Node1>
<SomeOtherNode>
<ValueToUse>123</ValueToUse>
</SomeOtherNode>
</Config>
I've attempted the following with no luck (it inserts the XQuery as the actual value):
update Table
set Column.modify('insert <Node1>//SomeOtherNode/ValueToUse/text()</Node1> as first into /Config')