I have XML in one of the column in the XYZ Table, here i Need to update Amount tag with new value instead of 0.00 and then PolicyReference and AccountReference I need to update two different values in these tags instead of Blank . For example -
<PolicyReference>7657576567</PolicyReference>
<AccountReference>7657576875</AccountReference>
This is my XML inside the column :-
<document>
<StatusCode>ACV</StatusCode>
<PaymentMethodDetail>
<EFT>
<AccountNumber>123456789</AccountNumber>
<AccountName>ABCDEFGHIJK</AccountName>
</EFT>
</PaymentMethodDetail>
<PaymentExtendedData>
<CHECK>
<Source>System</Source>
<SourceType>ACH</SourceType>
</CHECK>
</PaymentExtendedData>
<PostMarkDate />
<EntryUserId>1</EntryUserId>
<Amount>0.00</Amount>
<EntryDate />
<PolicyLineOfBusiness>LOL</PolicyLineOfBusiness>
</PolicyReference>
</AccountReference>
<AccountId>2034001793</AccountId>
</document>
This is what I have tried :-
Update XYZ
SET XmlPayload.modify('replace value of (//document/PolicyReference/)[1] with "<PolicyReference>275654</PolicyReference>"')
where PaymentSearchId =18785
I am getting an error message, please suggest me :- Msg 9341, Level 16, State 1, Line 4 XQuery [XYZ.XmlPayload.modify()]: Syntax error near ')', expected a step expression.