Parse JSON Data in Sql Server 2016

Sql server allows you to parse Json data with OpenJson .

Sample  Json data : [{“MinValue”:”1″,”MaxValue”:”6″}]

Parsing Json to map  into Tables:


declare @metadata="[{"MinValue":"1","MaxValue":"6"}]"
select Minvalue,MaxValue from openjson(@metadata)
with (MinValue nvarchar(2),MaxValue nvarchar(2));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s