Ask Your Question
1

What is the JSON_QUERY path in SQL Server 2019?

asked 2022-06-13 11:00:00 +0000

djk gravatar image

updated 2023-04-07 22:43:17 +0000

qstack gravatar image

What is the JSON_QUERY path in SQL Server 2019?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-06-19 19:00:00 +0000

woof gravatar image

updated 2023-04-07 21:12:46 +0000

qstack gravatar image

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:

JSON_QUERY (expression, 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 JSON_QUERY(json_data, '$.name') AS Name
FROM MyTable;

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-13 11:00:00 +0000

Seen: 21 times

Last updated: Apr 07 '23