Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [open-json]

OpenJson is a T-SQL (SQL Server) built in table valued function, introduced in 2016 version. Use this tag with questions related to this command.

open-json
55 questions with no upvoted or accepted answers
3 votes
2 answers
1k views

Accessing OPENJSON parsed JSON multiple times in a stored procedure?

Consider this JSON: { "Name": "Alice", "Relations": [ { "RelationId": 1, "Value": "one" }, ...
me.at.coding's user avatar
  • 16.7k
2 votes
0 answers
84 views

Entity Framework Core 8 Where IN vs Where IN OPENJSON Additional Question

I have reviewed the other post on this, and found my scenario to be much more un workable, to the extent that I am unsure if it is the way I am writing the query that is the issue. Surely it must be ...
Alex Holmes's user avatar
2 votes
1 answer
2k views

Access JSON_VALUE from SQL Column containing JSON String with Arrays

Looking to use JSON_VALUE to access some data within a JSON column in an SQL Server table. I have a table (tblMyTable) that has the following columns and data; | Column1 | JSONColumn | | -------- ...
CapnComic's user avatar
1 vote
1 answer
47 views

Extract head of an array using open_json?

I am have sample JSON as below { "12345": { "percent": 26, "avgPrice": 32, "avgNewOfferCount": 12, "avgUsedOfferCount&...
Aniruddhya Dutta's user avatar
1 vote
0 answers
180 views

SQL Server OPENJSON read nested JSON same key array

I am following the idea from Ed.Schavelev on article 'SQL Server OPENJSON read nested json'. But I need instead of repeating the rows I wanted them (4) to be in the columns. Is this possible? I have ...
Sanjoy's user avatar
  • 51
1 vote
1 answer
467 views

SQL Server JSON: error converting data type nvarchar to decimal... sometimes

I'm having a weird problem. I have the following SQL statement trying to parse a JSON file: SELECT A.subscription_id AS subscriptionid, A.customer_id AS customerid, A....
Benjamin Schneider's user avatar
1 vote
1 answer
108 views

Stored procedure with multiple insert

I want a value of #temp table and People table value together. I can use json_modify but it will work only for single value insert. But in case of multiple values, we can make both in JSON object ...
SHARAD KAFLE's user avatar
1 vote
0 answers
2k views

Multiple cross apply in SQL for a row with json

I have a row: id, shipping_data, line_data 0, '[{"name": "Greg", "Address": "test address"}]', '[{"products": "apple", "cost": &...
apolloSN's user avatar
1 vote
1 answer
1k views

how to measure length of array inside array in json file using SQL OPENJSON function with cross APPLY

"table": [ { "name": "Emergency", "columns": [ { ...
Raj Chanpura's user avatar
1 vote
2 answers
945 views

OPENJSON() SQL SERVER is returning null when the path is correct

This is the json i declare: DECLARE @json VARCHAR(MAX) = N' [ { "mTruckId": -35839339, "mPositionId": 68841545, "mPositionDateGmt": "laboris ipsum ullamco&...
Kevin's user avatar
  • 31
1 vote
0 answers
261 views

With SQL 2017 -- does OPENJSON remove the escape sequences from the raw JSON data

SQL proc consuming JSON payload from Web Service but the data was escaped before being received in the procedure. I have a payload like this: { "RES_NBR_ID": "00000056566", ...
user3297833's user avatar
1 vote
1 answer
29 views

How to insert only a portion of the JSON element into a SQL field

I'm using the following code in a SQL Server 2016 stored procedure and I would like to split the Journal ISSN value into 2 different fields. DECLARE @json nVARCHAR(MAX) = '[{"Journal ISSN" : "...
Bill's user avatar
  • 1,467
1 vote
1 answer
266 views

SQL query OpenJson with deep nested arrays loop

I know there a lot of similar questions and answers here. I've read most of them but I'm unable to query nested arrays in a JSON structure. I'm lost in the CROSS APPLY's. I'm actually querying a web ...
joachimb's user avatar
1 vote
0 answers
189 views

Can't expand JSON file in SQL Server using OPENJSON beyond 1st level

I am working with JSON that has been inserted into a SQL table and I have been trying to expand the dataset. So far I have been unable to expand beyond a single. The data looks like this in the ...
Matt's user avatar
  • 43
1 vote
0 answers
60 views

Migrating existing maprdb into mongodb. springboot hadoop and maprdb used in the application

' My application used springboot hadoop and maprdb. I never used springhadoop and maprdb before. Please guide. I want to remove maprdb code and connect with mangodb. my code is like this ' public ...
user206088's user avatar

15 30 50 per page