Questions tagged [json-value]
77 questions
0
votes
2 answers
SQL Server : SELECT JSON Column in this JSON Structure
I would like to know will it possible to select data from below JSON structure?
[
{
"A": 6,
"Status": 1
},
{
"A": 3,
"Status": 0
},
{
"A": 6,
"Status": 1
},
{
…

tsohtan
- 830
- 1
- 13
- 33
0
votes
3 answers
Compare Date saved as varchar with DateTime
I have a table with a column jsonStr of type varchar.
This is an example of an element in this column
{"Date":"/Date(1602846000000)/","person":"Laura"}
I want to compare this date with a static date. This is my query:
select *
from mytable
where…

Raouf Ghrissi
- 183
- 2
- 9
0
votes
0 answers
Count items of json string in SQL script (compatibility version 100, no openjson)
My Json string has couple of items and I can use json_value to get specific items and parse it. But need to know the length of items to iterate.
[
{"name":"Ram", "email":"Ram@gmail.com"},
{"name":"David", "email":"David@gmail.com"},
…

Aryan Firouzian
- 1,940
- 5
- 27
- 41
0
votes
2 answers
Extract Array Element From JSON Using T-SQL
I have a following response string from Google Geocoding API stored in a SQL Server database:
{
"results":[
{
"address_components":[
{
"long_name":"Khalifa City",
"short_name":"Khalifa…

knyazs
- 99
- 7
0
votes
1 answer
SQL JSON Query -retrieve data within a JSON array
I have the following SQL "Product" table structure:
int Id
nvarchar(max) Details
Details contains JSON a string having the following structure:
{
"Id": "10001",
"Description": "example description",
"Variants": [{
"Title": "ABC / no",
…

Razvan Olariu
- 59
- 1
- 8
0
votes
1 answer
Extracting Data from JSON Array using SQL
I have a nested JSON in a sql table column and need to parse out multiple values from the "delinquincies" array. highlighted with ** in the JSON below
{
"creditReportDetails":[
{
"accountStatusSummary":{
…

Ricky
- 123
- 9
0
votes
2 answers
JSON_VALUE is not working in where clause in SQL Server
I have JSON data in a column in my table. I am trying to apply where condition on the JSON column and fetch records.
Employee table:
Here is my SQL query:
SELECT ID, EMP_NAME
FROM EMPLOYEE
WHERE JSON_VALUE(TEAM, '$') IN (2, 3, 4, 5, 7, 10)
I am…

sridharnetha
- 2,104
- 8
- 35
- 69
0
votes
1 answer
Select Json Object as nvarchar(max) in JSON_VALUE
I do not know how to extract a path of JSON as nvarchar(max). It always returns null.
I do not want to specify the fields to get because I have no idea the field names. So the idea here is select it as a string and process them later.
DECLARE @json…

Hieu Le
- 1,042
- 8
- 18
0
votes
1 answer
SQL Server: How to remove a key from a Json object
I have a query like (simplified):
SELECT
JSON_QUERY(r.SerializedData, '$.Values') AS [Values]
FROM
r
WHERE ...
The result is like this:
{ "2019":120, "20191":120, "201902":121, "201903":134, "201904":513 }
How can I remove the…