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

Questions tagged [sql-server-json]

The tag has no usage guidance.

sql-server-json
1 vote
0 answers
63 views

Add JSON Array to text column in view [duplicate]

I want to take the below JSON file (people.json) in Synapse (Datalake) { "people": [ { "age": 25, "id": 2, "info": { &...
Dean's user avatar
  • 21
2 votes
2 answers
142 views

How to have JSON subquery return empty array rather than null when there are no rows [duplicate]

I have a (hypothetical) JSON schema that calls for a document to look like: [ { "tableName": "Embeddings", "object_id": 1301579675, "type_desc": &...
Ian Boyd's user avatar
  • 253k
0 votes
0 answers
51 views

How can I keep data with {} parameters in json format in my table and how can I use it in C#?

A few of my friends and I have been looking at this issue for a few days, but we couldn't figure it out. There are many texts to be used in the UI. These texts contain fields such as title, content ...
Büşra Altun's user avatar
-2 votes
1 answer
61 views

How to read a value from a particular object in a list with JSON string using MS SQL [closed]

[{ "resourceType": "virtualMachines", "name": "Standard_E16-4as_v5", "tier": "Standard", "size": &...
ARUNKUMAR RAVI's user avatar
1 vote
1 answer
127 views

Dynamic insert/update json array request to database

I have question about how to update/insert Json value into SQL Server. My logic was: frontend sends dynamic Json array value to me i.e they send Json array value (it have both insert and update value)....
Dotnet's user avatar
  • 63
1 vote
1 answer
164 views

Query json array with no property names [closed]

I have a nvarchar(max) column that contains a string array of tags. I am querying this columns for matching values using the JSON functions. While I do have it working, I wasn't sure if there was a ...
Tony Basallo's user avatar
  • 3,054
0 votes
2 answers
298 views

How can I convert this Json array in SQL Server?

I have an array like this and I want to extract its count into a single array. Can I do this in SQL Server? [ { "ItemName": "ITEM1", "Details": [ { ...
shan127's user avatar
  • 29
1 vote
1 answer
276 views

How to query a key in a SQL Server Json column if it could be a scalar value or an object?

I have a table that with a column Info VARCHAR(MAX) constrained to always be valid json. What is the best way to query a key with JSON_QUERY/JSON_VALUE if I don't know ahead of time if the value ...
will smith's user avatar
0 votes
1 answer
2k views

How to query a table with JSON column with key-value pairs to match all keys and values

Say I have an Image table with a meta column in JSON: Id Meta 1 { "size": 80, "effect": "blur" } 2 { "size": 200, "optimize": true } 3 { "...
icube's user avatar
  • 2,728
0 votes
1 answer
562 views

How to read a complex json array with SQL Server

This is my query: SELECT JSON_QUERY(MyStringColumnWithJson, '$.Images') AS images FROM MyTable which returns a single field with the JSON data shown here below: "{ "Images": ...
HelloWorld's user avatar
  • 4,822
0 votes
2 answers
2k views

Insert rows into SQL Server table from json

Trying to work up a stored procedure to insert json as rows into an existing empty table. The json properties match the table columns. This stored procedure returns 3 errors shown below the following ...
Vague's user avatar
  • 2,260
2 votes
1 answer
3k views

Create json key value from table column name and data

Is it possible to create JSON key value from a table SELECT statement, where column name as key and the column value as value declare @T table(Id int, ItemName varchar(10), CategoryId int, ItemDate ...
user12073359's user avatar
2 votes
2 answers
440 views

SQL Server parse JSON to update another table

I have a table with JSON data in one of the columns and i'm trying to parse the JSON data and insert into a temp table DECLARE @TEMPTABLE ( ID INT, Status NVARCHAR(50), Cost DECIMAL(...
RData's user avatar
  • 969
-1 votes
1 answer
1k views

SQL Server where Clause on JSON Field

I have a table ID | Start Date | End Date | Summary ---+-------------------+-------------------+---------------------------- 1 | 2020-01-01T09:20 | 2020-01-01T09:30 | {"total&...
Ali's user avatar
  • 99
4 votes
1 answer
1k views

TSQL: Recursive Descent in JSON Path

I was hoping to take advantage of $.. in json_value() function within TSQL queries using stored json documents. Unfortunately it doesn't work: JSON path is not properly formatted. Unexpected ...
sharpener's user avatar
  • 1,623

15 30 50 per page
1
2 3 4 5