Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update a node using XPath?

Status
Not open for further replies.

Kenbla

Programmer
Oct 11, 2006
68
SE
Hello, I have a table in an SQL Server database which contains a column of type=XML. I wonder if it is possible to update nodes in that table using XPath expressions?
I have an XML file that looks something like this:
<XMLRoot>
<Date>02/05/2011</Date>
<Misspelled>ABC</Misspelled>
<Customer>Microsoft</Customer>
</XMLRoot>
and I want to update the node "Misspelled" and set it to "Correct". Is this possible to do this with an XPath expression or what it is the best way to do this?
After the update I want the XML to look like this:
<XMLRoot>
<Date>02/05/2011</Date>
<Correct>ABC</Correct>
<Customer>Microsoft</Customer>
</XMLRoot>

Any help is greatly appreciated.
Regards
Kenbla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top