SQL Update for XML value in table

Posted on 2011-10-20
Last Modified: 2012-05-12
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??

Question by:red_75116
    LVL 26

    Accepted Solution

    LVL 74

    Assisted Solution

    by:käµfm³d 👽
    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


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now