SQL Flow Field Guide

ISJSON

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

JSON validity test

What changes

Input
string, optional type constraint
Output or change
1/0
Return type
Returns 1 if the string contains valid JSON; otherwise, returns 0. Returns NULL if expression is null. If the statement omits json_type_constraint, the function tests if the input is a valid JSON obje

Syntax at a glance

ISJSON ( expression [, json_type_constraint] )

Work example

Check imported JSON text before passing it to JSON query functions.

Test null and malformed values and use a type constraint when the shape must be an object or array.

Check your work ISJSON validates JSON syntax but does not confirm required keys or business rules.

Practice SQL

Open in SQL Flow
SELECT ISJSON(N'{"active":true}') AS is_valid_json;

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