Solved

xml modify sql 2008

Posted on 2012-03-09
2
309 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
2 Comments
 
LVL 59

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server: SNAPSHOT replication to include a newly added table. 2 30
sql help 8 58
PROPERCASE SCRIPT IN SQL 3 16
Need return values from a stored procedure 8 21
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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