[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Find nodes and change values in a xml (mssql)

Posted on 2012-08-15
5
Medium Priority
?
683 Views
Last Modified: 2012-08-30
Hello.

Can someone help me with one thing.

I need help with
1. Create a store procedure that finds
all nodes with name "XXX" in a xml document and set
the value YYY in those nodes.

2. I need to create a sp that finds all nodes with a VALUE YYY
and replace that with a new value ZZZ
0
Comment
Question by:pucko73
  • 3
5 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 38298728
Please post a sample Xml document and the final result.
0
 

Author Comment

by:pucko73
ID: 38299244
I don't want it to be specific to the xml. I want it to find every node in the xml that has a specific value

for example
<root>
<test1>@r1</test1>
<a>
<test1>@r1</test1>
</a>

</root>

i now want to replace all @r1
with XXX for example.


<root>
<test1>XXX</test1>
<a>
<test1>XXX</test1>
 
</a>

</root>
0
 

Author Comment

by:pucko73
ID: 38299256
Sorry that was for nr 2

for nr 1


<root>
<test1>x1</test1>
<a>
<test1>x2</test1>
</a>
</root>
Here I want to specify that I want to replace values in nodes with name test1 with value YYY
and get



<root>
<test1>YYY</test1>
<a>
<test1>YYY</test1>
</a>
</root>
0
 
LVL 9

Accepted Solution

by:
keyu earned 1500 total points
ID: 38304360
0
 

Author Comment

by:pucko73
ID: 38312935
I, men traveling and havet limiterad access tog internet.  Will check next week
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

873 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