SQL Server 2016 now includes support that means developers can output their query results to a JSON format.
FOR JSON Clause
Format data for JSON with control over objects
SELECT ProductNumber, Name, ListPrice FROM Production.Product FOR JSON PATH;
Format data for JSON with automatic formatting
SELECT ProductNumber, Name, ListPrice FROM Production.Product FOR JSON AUTO;
SQL Server 2016 supports the following built-in functions for JSON:
- ISJSON tests whether a string contains valid JSON.
- JSON_VALUE extracts a scalar value from a JSON string.
- JSON_QUERY extracts an object or an array from a JSON string.
No comments:
Post a Comment