Kumar AU

Kumar AU

  • 1.3k
  • 295
  • 56.8k

How to Update XML tags value with new values in SQL Script

Oct 2 2020 7:31 AM
This is my 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 diffrent values in these tags instead of Blank .
 
For example:- <PolicyReference>7657576567</PolicyReference>
<AccountReference>7657576875</AccountReference>
 
This is my XML document
  1. <document>  
  2. <StatusCode>ACV</StatusCode>  
  3. <PaymentMethodDetail>  
  4. <EFT>  
  5. <AccountNumber>123456789</AccountNumber>  
  6. <AccountName>ABCDEFGHIJK</AccountName>  
  7. </EFT>  
  8. </PaymentMethodDetail>  
  9. <PaymentExtendedData>  
  10. <CHECK>  
  11. <Source>System</Source>  
  12. <SourceType>ACH</SourceType>  
  13. </CHECK>  
  14. </PaymentExtendedData>  
  15. <PostMarkDate />  
  16. <EntryUserId>1</EntryUserId>  
  17. <Amount>0.00</Amount>  
  18. <EntryDate />  
  19. <PolicyLineOfBusiness>LOL</PolicyLineOfBusiness>  
  20. </PolicyReference>  
  21. </AccountReference>  
  22. <AccountId>2034001793</AccountId>  
  23. </document>  
Could you please let me now How do I achive this in SQL query

Answers (3)