Solved

xml modify sql 2008

Posted on 2012-03-09
2
311 Views
Last Modified: 2012-03-11
say i have a table that has 2 column 1 is id and other is xml data

i inserted
1, xml<test><q1></q1></test>

now i inserted
2, xml<test><q1></q1><q2></q2></test>

how do i detect to say 2 and 1 are really the same let me just add q2 into row 1 and delete row 2 using xml modify
0
Comment
Question by:StewSupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 37705298
How are you receiving the original information? Is it coming in as XML or are you converting it before insert? Your responses will help shape the final solution, but it will utilize XML.exist() method: http://msdn.microsoft.com/en-us/library/ms189869.aspx

I think if combined with with a WHERE NOT EXISTS can help yield the behavior you need.
0
 

Author Closing Comment

by:StewSupport
ID: 37708090
i found my answer before this post so i didn't try this i am using xml.modify. thanks
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

627 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