Questions tagged [sql-server-json]
The sql-server-json tag has no usage guidance.
sql-server-json
62
questions
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": {
&...
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": &...
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 ...
-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": &...
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)....
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 ...
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": [
{
...
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 ...
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
{ "...
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":
...
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 ...
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 ...
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(...
-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&...
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 ...