Updating XML with database information

I have a Blob in my database which contains an XML string, with names of fields and their values.
Some of those fields match fields in tables in my database. like say 'name' or 'address', etc. and other fields are not matched to my database but info that is relevant for other purposes.

We have a routine to send this XML string to a web service to be processed. BUT we need to do this BEFORE we send the XML to the web service.

We need to update the XML with the information we have in our database, THEN send it to the web service, this update only applies to the fields that match fields in the database, so that the name of the field is the same, then we need to update the value in the XML with the value we have in the database.

This is because often times the information in the database changes, like addresses, phone numbers, etc. And when we saved the Blob (XML) it had old numbers or addresses. This way when we send the XML for processing we are sending it with the NEW information and not the old one.

We just don't know how to create code to update the fields in the XML that match fields in our database.
We have a table (UserMap) which has the list of all the fields we have in the DB.

We are using MS SQL 2008 R2
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Redundant information shouldn't be stored at all..

You can use the modify() and  nodes() method of the XML data type.

The rest depends on the concrete XML and data model, but I could get really ugly.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AleksAuthor Commented:
I agree. Ill close this ticket and look at the option of saving ONLY data that does NOT come from the DB.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
XML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.