SQL Server 2016: Introduced JSON support, to store and retrieve JSON document

This is one of the interesting topics, in the new version of SQL Server 2016 we can store JSON formatted data.

Now a day JSON data type is a common feature for all new coming RDBMS product versions like: PostgreSQL 9.4 and MySQL 5.7 have already introduced this.

Now We can say, we have SQL Server 2016 with the RDBMS + NOSQL concepts.
We can store JSON data as nvarchar, but the JSON related functions have the advantage of enforcing that each stored value is valid according to the JSON rules.

Small demonstration on SQL Server 2016 JSON:

Create a sample table and define two column as NVARCHAR to store JSON data:

Use ISJSON() and add check constraint in json columns:
If your json format and document is correct, It returns true other It returns false.

Insert few sample JSON data:

SELECT json data:

Use JSON_VALUE() in WHERE Clause:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of