You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/t-sql/data-types/json-data-type.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: The native JSON data type provides advantages for storing JSON data
4
4
author: WilliamDAssafMSFT
5
5
ms.author: wiassaf
6
6
ms.reviewer: randolphwest, jovanpop, umajay
7
-
ms.date: 11/18/2025
7
+
ms.date: 01/14/2026
8
8
ms.service: sql
9
9
ms.subservice: t-sql
10
10
ms.topic: reference
@@ -102,6 +102,26 @@ SET d.modify('$.b', 'def')
102
102
WHERE id =1;
103
103
```
104
104
105
+
## Valid data
106
+
107
+
Input to the **json** data type must be a JSON object or a JSON array. Scalars, booleans, and `NULL` values are not supported. The JSON data type conforms to IETF RFC 4627 which allows only a JSON object or array. The **json** data type and all JSON functions only work with IETF RFC 4627 compliant JSON documents.
108
+
109
+
The [ISJSON](../functions/isjson-transact-sql.md) function can be used to validate a string that contains JSON document conforms to IETF RFC 8259. An IETF RFC 8259 conformant JSON document contains only a JSON scalar value at top level.
110
+
111
+
For example:
112
+
113
+
```sql
114
+
DECLARE @true JSON ='true'; -- invalid
115
+
DECLARE @false JSON ='false'; -- invalid
116
+
DECLARE @number JSON ='1234.56'; -- invalid
117
+
DECLARE @string JSON ='"contoso"'; -- invalid
118
+
DECLARE @null JSON ='null'-- invalid
119
+
120
+
DECLARE @null JSON =NULL-- valid
121
+
DECLARE @object JSON ='{}'-- valid
122
+
DECLARE @array JSON ='[]'-- valid
123
+
```
124
+
105
125
## Function support
106
126
107
127
All JSON functions support the **json** data type with no code changes or usage difference necessary.
@@ -147,8 +167,6 @@ Currently, the `OPENJSON()` function doesn't accept the **json** data type in so
147
167
148
168
- In [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)], the `OPENJSON()` function does support **json**. For more information, see [Key JSON capabilities in SQL Server 2025](../../relational-databases/json/json-data-sql-server.md#key-json-capabilities).
149
169
150
-
The top-level type must be a JSON Object or a JSON Array. Scalars, booleans, and null values are not supported.
Copy file name to clipboardExpand all lines: docs/t-sql/functions/isjson-transact-sql.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ If the *json_type_constraint* is specified then the function checks for the JSON
62
62
|`OBJECT`|Tests for a valid JSON object|
63
63
|`SCALAR`|Tests for a valid JSON scalar – number or string|
64
64
65
-
The **json_type_constraint** value SCALAR can be used to test for IETF RFC 8259 conformant JSON document that contains only a JSON scalar value at top level. A JSON document that doesn't contain a JSON scalar value at top level conforms with IETF RFC 4627.
65
+
The `json_type_constraint` value SCALAR can be used to test for IETF RFC 8259 conformant JSON document that contains only a JSON scalar value at top level. A JSON document that doesn't contain a JSON scalar value at top level conforms with IETF RFC 4627.
0 commit comments