Thursday, May 28, 2015

SQL Server += JSON

SQL Server to add JSON Support

"SQL Server 2016 is expected to offer native support for working with JSON. The first iteration of this support will be released as part of SQL Server 2016’s CTP 2.
...
The main CTP 2 feature is the ability to “format and export” JSON. This is done by appending a FOR JSON clause to the end of a SELECT statement. It is based on the FOR XML clause and, like it, allows for both automatic and semi-manual formatting of the resulting JSON string.
...
JSON data is stored as an nVarChar variable. This is also the case when storing JSON data inside table columns
...
To directly query JSON for scalar values, you can use the JSON_VALUE function. This function uses a JavaScript like notation to locate values within the JSON object. It uses the $ symbol as the object root, dot-notation for properties, and brackets for array indexes."

No comments: