• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

SQL Update for XML value in table

I have a table with about 200 records and I need to be able to update the values, but it is showing as a XML.

I need to update the AE value with the EN value?  Somehow need to parse this so it can be updated.  Is this possible??

file
0
red_75116
Asked:
red_75116
2 Solutions
 
käµfm³d 👽Commented:
Try this:


UPDATE [tableName]
set XMLValue.modify('replace value of (/langs/lang[@code="AE"]/text())[1] with (/langs/lang[@code="EN"]/text())[1]')

Open in new window

0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now