About 743,000 results
Open links in new tab
  1. How can I loop through a json array in sql to select a value at a ...

    Jul 28, 2016 · I have a stored procedure that query the database and store the result in a Json variable. Now I want to loop through the Json array by index to get a specific value. Can some tell me how to achiev...

  2. Working With JSON in SQL - GeeksforGeeks

    Apr 2, 2025 · In this article, we will learn how to store, retrieve, and manipulate JSON data in SQL Server using various SQL functions. We will learn how JSON fits into SQL, demonstrate how to store JSON data in SQL tables and cover the most common JSON functions like ISJSON (), JSON_VALUE (), JSON_MODIFY (), and more. What is JSON in SQL Server?

  3. How can I loop through array of json in SQL Server?

    Apr 10, 2020 · If you use SQL Server 2016+, you need to use OPENJSON() to parse the input JSON. The structure of the input JSON is always important and in this specific case you need to use OPENSJON() with explicit schema twice: JSON:

  4. The JSON_QUERY() function to extract objects from JSON Data - SQL

    May 19, 2020 · In this article, we explored JSON_QUERY() function to retrieve the JSON object and array from JSON data. It is a useful function to work with SQL Server JSON data. You should explore these functions and be familiar with the Javascript object Notation.

  5. Loop through JSON Cell In SQL Server - Stack Overflow

    If I understand the question correctly, you simply need to get the "$.data_set" part of the stored JSON using JSON_VALUE() and build the appropriate WHERE clause: DELETE TableOfJson WHERE JSON_VALUE(Json, '$.data_set') NOT IN ('17', '18')

  6. Work with JSON data in SQL Server - SQL Server | Microsoft Learn

    Nov 22, 2024 · Load JSON files into SQL Server. You can format information that's stored in files as standard JSON or line-delimited JSON. SQL Server can import the contents of JSON files, parse it by using the OPENJSON or JSON_VALUE functions, and load it into tables.

  7. JSON_QUERY (Transact-SQL) - SQL Server | Microsoft Learn

    Mar 6, 2025 · Extracts an object or an array from a JSON string. To extract a scalar value from a JSON string instead of an object or an array, see JSON_VALUE (Transact-SQL). For info about the differences between JSON_VALUE and JSON_QUERY, see Compare JSON_VALUE and JSON_QUERY. Transact-SQL syntax conventions. An expression.

  8. json_object and json_array SQL Server Functions

    Feb 3, 2023 · In SQL Server 2022, a new function named JSON_OBJECT was introduced to construct JSON objects using T-SQL. Also, the JSON_ARRAY was included to create arrays in JSON. This tutorial will show how to work with these new functions. The tutorial will include the following topics: For the last example, I will use the Adventureworks database.

  9. How to Display Nested JSON Data in SQL: A Step-by-Step Guide

    Feb 13, 2025 · Learn how to extract and display nested JSON data in SQL using `OPENJSON` and `CROSS APPLY` with a step-by-step guide.

  10. The Ultimate SQL Server JSON Cheat Sheet

    Mar 7, 2017 · Getting string JSON data into a SQL readable form. Checks to see if the input string is valid JSON. Extracts a specific scalar string value from a JSON string using JSON path expressions.

  11. Some results have been removed