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_10

10. Modifying JSON

Alex Grinberg
(1)
Richboro, Pennsylvania, USA
 
To insert, delete, and update data in a JSON document, SQL Server 2016 introduced the JSON_MODIFY() function that updates a JSON string value. This function, compared to XML modify() method, only has an append mode, as opposed to the insert, delete, and instead of modes provided by the XML method. Chapter 10 “Modifying JSON” will demonstrate many recipes explaining how to update a JSON document. In the final section of this chapter, I will compare the performance between XML and JSON.

10-1. Add ing a New Key-Value Pair to JSON

Problem

You want to add a new key-value pair ...

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