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

All Questions

-1 votes
1 answer
138 views

Parse JSON from tsql

I need to parse JSON using TSQL. I find a function to create a temporary table contains all values of the json and the mode to find every elements of it. Not there are an issue. I have a JSON with an ...
bircastri's user avatar
  • 2,113
0 votes
1 answer
170 views

OpenJson store processed object in original form

DECLARE @JSON NVARCHAR(MAX) = N'[ { "OrderNumber":"SO43659", "OrderDate":"2011-05-31T00:00:00", "AccountNumber":"AW29825", "ItemPrice&...
VivekL's user avatar
  • 65
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
0 votes
1 answer
5k views

OPENJSON with dynamic JSON key value pair

we are having a JSON document, where week numbers are dynamic keys. We want to load them to a relational table. We are able to achieve relational resultset, if we hardcode the weeknumbers, as given ...
Venkataraman R's user avatar
1 vote
1 answer
1k views

Loop through JSON in SQL Server 2016

I have a following JSON { "href": { "host": "localhost", "port": 2222 }, "name": "20190812", "scheduledStartTime": "2019-08-12T12:22:52.500-04:00", "parameters": { "1251226": { ...
Priyanka Khairnar's user avatar
-1 votes
2 answers
52 views

JSON SQL Server 2016 parse

I have a nested JSON as output form a form and I need to parse it in order to send it in joined tables. I cannot parse some of the data I have in the JSON: labels, rangesValues or body I get NULL ...
drcz's user avatar
  • 23
0 votes
1 answer
70 views

Parse JSON String with TSQL

I'm a little confused about how to parse a JSON string with TSQL. I've been watching Youtube movies for hours, but unfortunately I haven't found a solution yet. This is the JSONstring: {"event":"...
Dick ter Schiphorst's user avatar
1 vote
1 answer
3k views

How to get json object property without using OPENJSON

Following is my script to get specific value(OldPTValue, NewPTValue) from table HistoryTracking. I'm using OPENJSON but getting compatibility issue. Is there any way to get data without using OPENJSON ...
Ritesh Gore's user avatar
0 votes
1 answer
53 views

Pass JSON directly to SQL Server 2016

I would like to pass an JSON object to a SQL Server 2016 stored procedure without deserializing the object and let the database process the data. I'm passing in: DECLARE @json NVarChar(2048) = N'[{...
Bill's user avatar
  • 1,467
2 votes
1 answer
1k views

A concatenation OPENJSON in a SQL Server 2016 stored procedure

I need to combine all of the authors for a particular UID. The basic fields are working from the code at another post. DECLARE @json NVARCHAR(MAX) SET @json = '{ "header": { "...
Bill's user avatar
  • 1,467
0 votes
1 answer
1k views

OPENJSON syntax in a stored procedure in SQL Server 2016

I'm following the last example on this page https://www.sqlservercentral.com/forums/topic/using-msxml2-serverxmlhttp-within-stored-procedure-to-grab-source-of-html-page-and-save-to-table. It pulls ...
Bill's user avatar
  • 1,467
0 votes
1 answer
3k views

OPENJSON not available on SQL Server 2016 with compatibility level set to 130

I am attempting to use OPENJSON in a database that is running on SQL Server 2016, and get the following error when running this simple test query (which works fine on a different 2016 database) ...
mituw16's user avatar
  • 5,218
0 votes
3 answers
958 views

OPENJSON does not select all documents into the SQL table

I have been trying to export the contents of a JSON file to an SQL Server table. However, despite the presence of multiple rows in the JSON, the output SQL table consists of only the first row from ...
Darsh Khetan's user avatar
2 votes
2 answers
1k views

How to parse JSON string recursively with openjson

I have the following JSON data : set @json = N'{ "Book":{ "IssueDate":"02-15-2019" , "Detail":{ "Type":"Any Type" , "Author":{ "Name":"...
Annie's user avatar
  • 139
0 votes
1 answer
126 views

Importing nested name-value pairs from json into SQL Server

I am importing a json file into SQL 2016 which has some nested name-value pairs in a nested values structure. It's the values from these pairs I am having problems with, such as . { "name": "Colour", ...
Fetchez la vache's user avatar

15 30 50 per page