{"id":4014,"date":"2015-10-25T18:46:40","date_gmt":"2015-10-25T13:16:40","guid":{"rendered":"http:\/\/sqlhints.com\/?p=4014"},"modified":"2016-03-18T22:26:20","modified_gmt":"2016-03-18T16:56:20","slug":"json-in-sql-server-2016","status":"publish","type":"post","link":"https:\/\/sqlhints.com\/2015\/10\/25\/json-in-sql-server-2016\/","title":{"rendered":"Native JSON Support in Sql Server 2016"},"content":{"rendered":"<p style=\"text-align: justify;\">Native JSON (Java Script Object Notation) support is one of the new feature that is coming with Sql Server 2016.<\/p>\n<h3>Introduction to JSON<\/h3>\n<p style=\"text-align: justify;\">JSON is simple data representation format, which readable, portable and platform independent. Now JSON is a popular lightweight data-exchange format between the systems. Prior to JSON, web Services used XML as their primary data format for data-interchange. Now JSON is the preferred data-interchange format used by the Web APIs. To know more on JSON you can visit <a href=\"http:\/\/json.org\/\">http:\/\/json.org\/<\/a><\/p>\n<p><strong>JSON Anatomy<\/strong><br \/>\n<a href=\"https:\/\/sqlhints.com\/wp-content\/uploads\/2015\/10\/JSON-Structure.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqlhints.com\/wp-content\/uploads\/2015\/10\/JSON-Structure.jpg\" alt=\"JSON Structure\" width=\"550\" height=\"433\" class=\"alignnone size-full wp-image-4185\" \/><\/a><\/p>\n<li><strong>JSON Notations<\/strong><br \/>\n<strong>&#8221;       <\/strong> : JSON Property Name and value (if it is string) is enclosed within double quotes<br \/>\n<strong>:       <\/strong> : Colon symbol is used as the separator between the JSON property Name and Value.<br \/>\n<strong>{}      <\/strong> : Curly braces symbol represents the objects<br \/>\n<strong>[,]     <\/strong> : Arrays of Value<br \/>\n<strong>[{},{}] <\/strong> : Arrays of Objects<\/li>\n<p>To know more on JSON you can visit <a href=\"http:\/\/json.org\/\" target=\"_blank\">http:\/\/json.org\/<\/a><\/p>\n<h3>JSON In Sql Server 2016<\/h3>\n<p style=\"text-align: justify;\">JSON implementation in Sql server is on the similar lines as that of XML. One major difference is: JSON doesn\u2019t have native JSON data type like the XML data type. We can store JSON data in regular NVARCHAR\/VARCHAR column.<\/p>\n<p style=\"text-align: justify;\">Below are the main JSON features introduced in Sql Server 2016. Click on the link to understand each of these features with an extensive list of examples.<\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/for-json-clause-in-sql-server-2016\/\" target=\"_blank\"><strong>FOR JSON Clause<\/strong>: can be used to convert the query result (rows) to JSON format.<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/22\/openjson-function-in-sql-server-2016\/\" target=\"_blank\"><strong>OPENJSON Function<\/strong> : is very much similar to the OPENXML function, it provides a rowset view of the JSON. It is basically a table valued function, that can be used to transform the JSON value to one or many rows<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/isjson-function-in-sql-server-2016\/\" target=\"_blank\"><strong>ISJSON <\/strong> Function: This function validates whether the parameter supplied to it is a well formed JSON or not<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/json_value-function-in-sql-server-2016\/\" target=\"_blank\"><strong>JSON_VALUE <\/strong> Function: This function returns the scalar value from the input JSON text from the specified JSON path location<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/json_query-function-in-sql-server-2016\/\" target=\"_blank\"><strong>JSON_QUERY<\/strong> Function: This function extracts the JSON fragment (i.e. JSON object or an array) from the input JSON string from the specified JSON path.<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2016\/03\/18\/json_modify-function-in-sql-server-2016\/\" target=\"_blank\"><strong>JSON_MODIFY<\/strong> Function: This function can be used to update the value of the property in a JSON string and returns the updated JSON string.<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/28\/indexing-strategy-for-json-value-in-sql-server-2016\/\" target=\"_blank\"><strong>Indexing Strategy<\/strong> for JSON Value in Sql Server 2016<\/a><\/p>\n<p><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/lax-and-strict-json-path-modes-in-sql-server-2016\/\" target=\"_blank\"><strong>lax<\/strong> and <strong>strict<\/strong> JSON Path modes in Sql Server 2016<\/a><\/p>\n<p><strong>[ALSO READ]:<\/strong><\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td style=\"border: 1pt solid windowtext; text-align: left; color: white; background-color: #808080;\" colspan=\"2\" valign=\"top\"><strong>New features in SQL SERVER 2016<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"border: 1pt solid windowtext; text-align: left; background-color: #d8d8d8;\" colspan=\"2\">\n<ul>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/10\/25\/json-in-sql-server-2016\/\" target=\"_blank\">Native JSON Support in Sql Server 2016<\/a>\n<ul>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/for-json-clause-in-sql-server-2016\/\" target=\"_blank\">FOR JSON Clause in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/22\/openjson-function-in-sql-server-2016\/\" target=\"_blank\">OPENJSON Function in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/isjson-function-in-sql-server-2016\/\" target=\"_blank\">ISJSON Function in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/json_value-function-in-sql-server-2016\/\" target=\"_blank\">JSON_VALUE Function in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/json_query-function-in-sql-server-2016\/\" target=\"_blank\">JSON_QUERY Function in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2016\/03\/18\/json_modify-function-in-sql-server-2016\/\" target=\"_blank\">JSON_MODIFY Function in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/15\/lax-and-strict-json-path-modes-in-sql-server-2016\/\" target=\"_blank\">lax and strict JSON Path modes in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/28\/indexing-strategy-for-json-value-in-sql-server-2016\/\" target=\"_blank\">Indexing Strategy for JSON Value in Sql Server 2016<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/12\/drop-if-exists-statement-in-sql-server-2016\/\" target=\"_blank\">DROP IF EXISTS Statement in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/11\/29\/compare-execution-plan-in-sql-server-2016\/\" target=\"_blank\">Compare Execution Plans in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/11\/live-query-statistics-in-sql-server-2016\/\" target=\"_blank\">Live Query Statistics in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/12\/datediff_big-function-in-sql-server-2016\/\" target=\"_blank\">DATEDIFF_BIG Function in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/12\/difference-between-datediff-and-datediff_big-functions-in-sql-server\/\" target=\"_blank\">Difference between DATEDIFF and DATEDIFF_BIG functions in Sql Server<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/15\/session_context-in-sql-server-2016\/\" target=\"_blank\">SESSION_CONTEXT in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/28\/gzip-compress-and-decompress-functions-in-sql-server-2016\/\" target=\"_blank\">GZIP COMPRESS and DECOMPRESS functions in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/31\/temporal-tables-in-sql-server-2016-part-1-introduction-to-temporal-tables-and-dml-operations-on-the-temporal-table\/\" target=\"_blank\">Temporal Tables in Sql Server 2016<\/a><\/li>\n<ul>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/31\/temporal-tables-in-sql-server-2016-part-1-introduction-to-temporal-tables-and-dml-operations-on-the-temporal-table\/\" target=\"_blank\">Introduction to Temporal Tables and DML operations on the Temporal Table<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/31\/temporal-tables-in-sql-server-2016-part-2-querying-system-versioned-temporal-table\/\" target=\"_blank\">Querying System-Versioned Temporal Table<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/31\/temporal-tables-in-sql-server-2016-part-3-enabling-system-versioning-for-an-existing-regular-table\/\" target=\"_blank\">Enabling System Versioning for an Existing Regular Table<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2015\/12\/31\/temporal-tables-in-sql-server-2016-part-4-ddl-operations-on-the-system-versioned-temporal-table\/\" target=\"_blank\">DDL operations on the System-Versioned Temporal Table<\/a><\/li>\n<\/ul>\n<li><a href=\"https:\/\/sqlhints.com\/2016\/01\/23\/row-level-security-in-sql-server-2016\/\" target=\"_blank\">Row level security in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2016\/02\/21\/dynamic-data-masking-in-sql-server-2016\/\" target=\"_blank\">Dynamic Data Masking in Sql Server 2016<\/a><\/li>\n<li><a href=\"https:\/\/sqlhints.com\/2016\/03\/13\/string_split-function-in-sql-server-2016\/\" target=\"_blank\">STRING_SPLIT function in Sql Server 2016<\/a><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Native JSON (Java Script Object Notation) support is one of the new feature that is coming with Sql Server 2016. Introduction to JSON JSON is simple data representation format, which readable, portable and platform independent. Now JSON is a popular lightweight data-exchange format between the systems. Prior to JSON, web Services used XML as their &hellip; <a href=\"https:\/\/sqlhints.com\/2015\/10\/25\/json-in-sql-server-2016\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Native JSON Support in Sql Server 2016<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3,830],"tags":[865,871,937,832,895,833,321,835,986,834],"class_list":["post-4014","post","type-post","status-publish","format-standard","hentry","category-sql-server","category-sql-server-2016","tag-json","tag-json-in-sql","tag-json-in-sql-2016","tag-json-in-sql-server","tag-json-in-sql-server-2016","tag-native-json-support-in-sql-server","tag-sql","tag-sql-2016","tag-sql-server","tag-sql-server-2016"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3xNAz-12K","_links":{"self":[{"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/posts\/4014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/comments?post=4014"}],"version-history":[{"count":44,"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/posts\/4014\/revisions"}],"predecessor-version":[{"id":4838,"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/posts\/4014\/revisions\/4838"}],"wp:attachment":[{"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/media?parent=4014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/categories?post=4014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlhints.com\/wp-json\/wp\/v2\/tags?post=4014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}