Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

JSONQUERY path is a function in SQL Server 2019 that returns a JSON fragment of the expression provided according to the JSON path specified. The syntax for JSONQUERY is:

JSONQUERY (expression, JSONPath)

The JSONPath is a string that specifies the path to the desired JSON object or array. For example, the following query retrieves the value of the "name" property from a JSON document stored in a column called "jsondata":

SELECT JSONQUERY(jsondata, '$.name') AS Name FROM MyTable;

In this example, the JSON path '$.name' points to the "name" property of the JSON document.

click to hide/show revision 2
No.2 Revision

JSONQUERY path is a function in SQL Server 2019 that returns a JSON fragment of the expression provided according to the JSON path specified. The syntax for JSONQUERY is:

JSONQUERY

JSON_QUERY (expression, JSONPath)

JSON_Path)

The JSONPath is a string that specifies the path to the desired JSON object or array. For example, the following query retrieves the value of the "name" property from a JSON document stored in a column called "jsondata":

SELECT JSONQUERY(jsondata, JSON_QUERY(json_data, '$.name') AS Name
FROM MyTable;

MyTable;

In this example, the JSON path '$.name' points to the "name" property of the JSON document.