About 51 results
Open links in new tab
  1. sql - Convert select query results into Json - Stack Overflow

    Aug 11, 2018 · I want to execute a select query on a table and I need this result in a JSON format or in an excel sheet. I want to do this using query only and I'm using SQL Server 2014. Here is the table …

  2. Get Value From Json object contain table column using SQL Query

    22 I have a table Books with two columns Id, BookCategory in a SQL Server database, where Id is the primary key and BookCategory contains JSON object. This my table Books I'm trying to get table …

  3. How to produce JSON strings from SQL Server queries via TSQL?

    SELECT JSON_QUERY(( SELECT [current],target FROM YourTable FOR JSON PATH )) Works well with minimal effort. I generally convert the output to a List<Dictionary<string,dynamic>> in C#/.Net (if …

  4. Extracting values from JSON text in SQL Server - Stack Overflow

    Note, that the reason for the NULL results is the fact, that B key in the input JSON is a JSON array, so you need to use JSON_QUERY() to get the whole JSON array and additional CROSS APPLY to …

  5. json - Using OPENJSON in SQL Server Query - Stack Overflow

    Apr 6, 2022 · 2 I'm trying to pull some information from a JSON array stored in an SQL Server database. I can see I need to use OPENJSON, and I've found numerous examples of how to use it, but the rub …

  6. How to force SQL Server to return empty JSON array

    Sep 19, 2016 · I'm using SQL Server 2016, which supports JSON PATH to return JSON string. I wonder how to get just a simple empty json array, I mean [] when my query or sub-query returns null.

  7. SQL server: select all json array elements using JSON_QUERY

    What is your SQL Server version? If you can use JSON_QUERY(), you should be able to use OPENJSON().

  8. Accessing JSON Array in SQL Server 2016 using JSON_VALUE

    Jul 10, 2016 · I am stuck while accessing array inside json using newly introduced JSON_VALUE function. Please consider following code - IF EXISTS(SELECT 1 FROM …

  9. Querying json key name in SQL Server - Stack Overflow

    Querying json key name in SQL Server Asked 8 years, 8 months ago Modified 8 years, 2 months ago Viewed 33k times

  10. sql - How to convert rows to JSON in TSQL select query? - Stack Overflow

    Oct 18, 2017 · Following query returns whole table as single JSON string (list of JSON objects - one per row): SELECT * FROM MyTable FOR JSON AUTO I need to return multiple rows where each row …