O'Reilly logo

XML and JSON Recipes for SQL Server: A Problem-Solution Approach by Alex Grinberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

©  Alex Grinberg 2018
Alex GrinbergXML and JSON Recipes for SQL Serverhttps://doi.org/10.1007/978-1-4842-3117-3_5

5. Modifying XML

Alex Grinberg
(1)
Richboro, Pennsylvania, USA
 
XML XQuery has the ability to modify an XML instance for the XML variable and XML columns. The XQuery modify() method provides the ability to add, delete, and update the XML elements, attributes, and their values. This chapter will discuss and demonstrate real case scenarios to apply the modify() method for XML instances.

5-1. Inserting a Child Element into Your XML

Problem

You want to insert a child element into an existing XML instance.

Solution

You may encounter a situation in which you need to insert an XML element into an existing XML instance. Consider the simple XML data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required