SQL Flow Field Guide

JSON_ARRAY

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

JSON extract, test, modify or construct

What changes

Input
JSON text or values
Output or change
scalar, fragment, or constructed JSON
Return type
Returns a valid JSON array string of nvarchar(max) type. If the RETURNING json option is included then the JSON array is returned as json type. For more info about what you see in the output of the JS

Syntax at a glance

JSON_ARRAY ( [ <json_array_value> [ , ...n ] ] [ <json_null_clause> ] [ RETURNING json ] )

Work example

Construct a small JSON array from scalar expressions in a result projection.

Keep values typed and choose the JSON return option only when the target version supports it.

Check your work SQL Server 2025 can return the native JSON type, while the default result is JSON text.

Open Microsoft Learn for full syntax, permissions, and details for your version.