Skip to content

Fix SQL output binding for native json data type columns#1222

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-sql-output-binding-json-issue
Draft

Fix SQL output binding for native json data type columns#1222
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-sql-output-binding-json-issue

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 7, 2026

  • Fix GetColumnDefinitionsQuery() in src/SqlAsyncCollector.cs to handle the native json data type by mapping it to nvarchar(max) in the OPENJSON WITH clause, preventing the invalid json(max) syntax
  • Verify the fix builds correctly (build succeeded)
  • Verify existing unit tests pass (129/129 passed)
  • Run validation (code review ✅, CodeQL ✅)
  • Add unit test for GetColumnDefinitionsQuery to verify the generated SQL maps json columns to nvarchar(max)
  • Run tests to confirm new test passes (130/130 passed)
  • Run final validation (code review ✅, CodeQL ✅)

…nvalid json(max) syntax

Map native SQL json columns to nvarchar(max) in the OPENJSON WITH clause,
since the json data type does not accept a length specifier and may not be
directly supported in OPENJSON WITH on all platforms.

Agent-Logs-Url: https://github.com/Azure/azure-functions-sql-extension/sessions/da64a8d9-f082-4aae-8808-820e4a41806c

Co-authored-by: VasuBhog <23587151+VasuBhog@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unsupported syntax in SQL output binding for JSON Fix SQL output binding for native json data type columns Apr 7, 2026
Copilot AI requested a review from VasuBhog April 7, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure Functions SQL output binding JSON problem

2 participants