Skip to content

Commit

Permalink
1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Spendolini authored and Brian Spendolini committed Jul 23, 2024
1 parent 1f98462 commit ba66c0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/6-JSON-in-the-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## JSON in the Azure SQL Database

Along with the the new JSON data type, transact-SQL supports various functions and operators that can be used to work with JSON documents in the Azure SQL database. The available functions are:
Along with the new JSON data type, transact-SQL supports various functions and operators that can be used to work with JSON documents in the Azure SQL database. The available functions are:

1. **[ISJSON](https://learn.microsoft.com/sql/t-sql/functions/isjson-transact-sql)**: Tests whether a string contains valid JSON.
1. **[JSON_PATH_EXISTS](https://learn.microsoft.com/sql/t-sql/functions/json-path-exists-transact-sql)**: Tests whether a specified SQL/JSON path exists in the input JSON string.
Expand Down Expand Up @@ -183,7 +183,7 @@ The available operators are:
) AS T;
```

1. Relational data can bw transformed into a JSON string using the new JSON_OBJECT and JSON_ARRAY functions. The new JSON_ARRAY function takes N values that can be specified as a constant, expression, variable, or column reference and formats them into a JSON array value. Using the query sheet, issue the following command:
1. Relational data can be transformed into a JSON string using the new JSON_OBJECT and JSON_ARRAY functions. The new JSON_ARRAY function takes N values that can be specified as a constant, expression, variable, or column reference and formats them into a JSON array value. Using the query sheet, issue the following command:

```SQL
SELECT o.OrderNumber,
Expand Down Expand Up @@ -233,7 +233,7 @@ The available operators are:
ON a.AccountNumber = o.AccountNumber;
```

1. In the last example, a JSON aggregates is used with a GROUP BY clause like any aggregate that exists in Azure SQL Database today. Using the query sheet, issue the following command:
1. In the last example, a JSON aggregates is used with a GROUP BY clause like any aggregate that exists in Azure SQL Database today. Using the query sheet, issue the following command:

```SQL
SELECT schema_id, JSON_OBJECTAGG(name:object_id), JSON_ARRAYAGG(object_id), COUNT(*)
Expand Down

0 comments on commit ba66c0a

Please sign in to comment.