Skip to main content
Returns whether the input string is a valid JSON document. Returns NULL if the input is NULL.

Syntax

JSON_IS_VALID(<json_string>)

Aliases

JSON_VALID(<json_string>)

Parameters

ParameterDescriptionSupported input types
<json_string>The string to validate as JSON.TEXT

Return Type

The JSON_IS_VALID function returns a result of type BOOL.

Remarks

If you want to know why the input string is invalid JSON, you can also use the CHECK_JSON function.

Examples

Example The following code example validates a simple JSON string:
SELECT JSON_IS_VALID('{"name": "John"}');
Returns: TRUE The previous code example returns TRUE because the input string is valid JSON. Example The following code example validates a simple JSON string:
SELECT JSON_IS_VALID('{"name": "John"}{"name": "John"}');
Returns: FALSE The previous code example returns FALSE because the input string is invalid JSON as it contains two JSON objects next to each other.