XML Question

  • Hi All, hoping someone will be able to help me with this. Here is the problem. I have a table which stores XML data in a varchar(max) column. Not my choice, the database is part of an off the shelf application.

    What would be the best way of:

    i) Checking the values of specific elements within this XML data (bearing in mind its stored as varchar)

    ii) Updating these elements if required.

    Thanks in advance guys.

  • I think MSDN has an article on this exact subject. Search in there, you'll probably find it.

    Basically, to find the data in the column, you can cast it to XML data type, then query that with the usual XML query commands. To update it, you'll need to build Replace commands to directly manipulate the string (I think).

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply