I have an xml in my SQL Server table like this:
<Category>
<Attributes>
<Attribute>
<Name>GeneratorOnBoard1</Name>
<Value>Yes</Value>
</Attribute>
<Attribute>
<Name>GeneratorOnBoard2</Name>
<Value>Yes</Value>
</Attribute>
</Attributes>
</Category>
I want to replace the value of GeneratorOnBoard1 from 'yes' to 'yes please' but should not change the value of GeneratorOnBoard2.
If I use this:
declare @xml xml=''
select cast (replace (cast(@xml as nvarchar(max)), 'yes','yes please') as xml)
it might replace all the yes values.
What should I do?