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 one 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
|
JSON (as you surely know if you're reading this blog) is a file format for holding structured data. Here's the start of a typical JSON file, holding Star Wars characters (more on these later):

The results section of this JSON file contains a dictionary of characters in the Star Wars filims.
This blog will show you how to store data in the json field type:

The FilmJson column holds JSON text listing all of the Star Wars films.
Creating fields like this:

The FilmJson field has data type json.
This blog will also show you how to extract information from this into SQL Server format:

This is the same data in a more familiar format.
We'll also look at writing SQL like this to link T-SQL and JSON data together:
SELECT
f.FilmId,
j.FilmTitle
FROM
tblFilm AS f
CROSS APPLY OPENJSON(f.FilmJson, '$.results')
WITH (
FilmTitle nvarchar(200) '$.title'
) AS j;
Let's get started with something which isn't strictly JSON at all: how to load our sample Star Wars data into a SQL variable.
| Parts of this blog |
|---|
|
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.