Read and parse JSON in T-SQL / SQL Server

visibility 1,010 access_time 4 years ago languageEnglish timeline Stats
timeline Stats
Page index 0.94

JSON is commonly used in modern applications for data storage and transfers. Pretty much all programming languages provide APIs to parse JSON. 

From SQL Server 2016 on wards, JSON functions are commonly supported. You can use JSON_VALUE function to extract data from JSON columns.

Refer to the following page about more details of JSON functions:

JSON Functions (Transact-SQL)

Code snippet

WITH JSON_STR AS
(
select '{"Name":"A","Value":2}' as JSON_COLUMN
)
SELECT json_value(JSON_COLUMN, '$.Name') as Name,
json_value(JSON_COLUMN, '$.Value') as Value
from JSON_STR;
info Last modified by Raymond 4 years ago copyright This page is subject to Site terms.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

More from Kontext
Calculate time difference in T-SQL / SQL Server
visibility 111
thumb_up 0
access_time 3 years ago
Add user for Azure SQL Database
visibility 49
thumb_up 0
access_time 10 months ago