Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
428 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Some other pages relevant to these blogs include:
You can also book hourly online consultancy for your time zone with one of our 7 expert trainers!
|
Using JSON in SQL Server, including the new SQL 2025 functions Part eight of an eight-part series of blogs |
|---|
|
SQL Server 2025 introduces a new JSON data type and some new JSON functions - we thought we'd use this as an excuse to create this masterclass on working with JSON in SQL Server
|
Although it's apparently currently in preview, SQL Server 2025 now allows you to modify JSON. This is easiest to show by example. Suppose we have our standard list of films:

The second column contains the JSON for the films.
This is how the JSON starts:

We want to change the director of the first film in the results section of the JSON to Bobby the Owl.
Here's some SQL to do this:
-- change the director of the first film to Bobby the Owl
UPDATE tblFilm
SET FilmJson.modify('$.results[0].director','Bobby the Owl')
-- prove this worked
SELECT
tblFilm.FilmId,
f.Title,
f.Director
FROM
tblFilm
CROSS APPLY OPENJSON(FilmJson, '$.results')
WITH(
Title nvarchar(200) '$.title',
Director nvarchar(200) '$.director'
) AS f
And here's what this would then show:

The director of the first film has been changed.
You can specify any valid Json path as an argument to the modify method.
Some other pages relevant to these blogs include:
You can also book hourly online consultancy for your time zone with one of our 7 expert trainers!
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2025. All Rights Reserved.