-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Update json-data-type.md #10211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update json-data-type.md #10211
Conversation
|
If you want to test it yourself you can run this code (it requires that the cross join product of sys.all_objects produces more than 65535 rows): |
|
Learn Build status updates of commit 00bc200:
|
| File | Status | Preview URL | Details |
|---|---|---|---|
| docs/t-sql/data-types/json-data-type.md | Details |
docs/t-sql/data-types/json-data-type.md
- Line 1, Column 1: [Warning: author-missing - See documentation]
Missing required attribute: 'author'. Add the current author's GitHub ID. - Line 1, Column 1: [Warning: title-missing - See documentation]
Missing required attribute: 'title'. Add a title string to show in search engine results. - Line 1, Column 1: [Warning: ms-author-missing - See documentation]
Missing required attribute: 'ms.author'. Add the current author's Microsoft alias. - Line 1, Column 1: [Warning: ms-topic-missing - See documentation]
Missing required attribute: 'ms.topic'. - Line 18, Column 1: [Warning: h1-not-first - See documentation]
Markdown content is not allowed before H1 'JSON data type'. - Line 1, Column 1: [Suggestion: ms-date-missing - See documentation]
Missing required attribute: 'ms.date'. - Line 1, Column 1: [Suggestion: description-missing - See documentation]
Missing required attribute: 'description'. - Line 1, Column 1: [Suggestion: ms-service-suggested]
Missing required attribute: 'ms.service'. ms.service is suggested for Yaml:Mime type: Module.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
|
Can you review the proposed changes? Important: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR documents a limitation of the JSON data type in SQL Server, specifically regarding the maximum number of items allowed in a single object or array. The documentation adds a new section explaining that JSON objects and arrays are limited to 65,535 items (the maximum value of a 16-bit unsigned integer) and describes the error that occurs when this limit is exceeded.
- Added documentation about the 65,535 item limit for JSON objects/arrays
- Included example error message that users will encounter when exceeding the limit
- Noted that TRY_CAST also throws the same error
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,4 +1,4 @@ | |||
| --- | |||
| <img width="100" height="19" alt="image" src="https://github.com/user-attachments/assets/97427a9d-b373-460a-a4d7-1bd32ca6fb42" />--- | |||
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image tag appears to have been accidentally inserted before the document frontmatter delimiter. This will break the YAML frontmatter parsing. The line should only contain '---'.
|
|
||
| - 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). | ||
|
|
||
| ### Size limit for Items in one object/array |
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected capitalization of 'Items' to 'items' in the heading for consistency with standard heading capitalization.
| ### Size limit for Items in one object/array | |
| ### Size limit for items in one object/array |
| The **JSON type** has a size limit of **65,535 items** per object or array — this corresponds to the maximum value of a 16-bit unsigned integer. | ||
| If you attempt to cast text into the JSON type and it contains more than 65,535 elements, the following error will be thrown: |
Copilot
AI
Nov 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term 'JSON type' should be consistently formatted as 'json' (lowercase, in code style) to match the formatting used elsewhere in the document when referring to the data type itself.
| The **JSON type** has a size limit of **65,535 items** per object or array — this corresponds to the maximum value of a 16-bit unsigned integer. | |
| If you attempt to cast text into the JSON type and it contains more than 65,535 elements, the following error will be thrown: | |
| The **json** data type has a size limit of **65,535 items** per object or array — this corresponds to the maximum value of a 16-bit unsigned integer. | |
| If you attempt to cast text into the **json** data type and it contains more than 65,535 elements, the following error will be thrown: |
|
Thanks @bpp-incom for contacting Microsoft with a contribution to our product documentation. I've reached out to the product group to confirm. It could take from a few business days to a few weeks to confirm your change internally. We'll contact you if we need further information, and you'll receive an email message each time we "@mention" you in a comment. By opening a pull request, you're helping the authors add your approved change directly to the documentation. If the article is updated with your commit, GitHub will list you as an article contributor. Thanks again for this feedback. Your suggestions help improve our documentation. |
|
Thanks @bpp-incom for taking the time to submit this PR! Good catch. This article update is in flight. After the updated article is published, GitHub will list you as a commit co-author. Thanks again for this feedback, your suggestions help improve our documentation. |
Described the limitation of the JSON type.