- Categories:
CHECK_JSON¶
Checks the validity of a JSON document. If the input string is a valid JSON document or a NULL, the output is NULL (i.e. no error). If the input cannot be translated to a valid JSON value, the output string contains the error message.
Syntax¶
Arguments¶
string_or_variant_exprA
VARIANTor string value (or expression) to check.If the expression is of type
VARIANT, it should contain a string.
Examples¶
Create a table and insert some VARCHAR and VARIANT values:
Use the CHECK_JSON function to check the validity of potential
JSON-compatible strings in a VARCHAR column:
Use the CHECK_JSON function to check the validity of potential
JSON-compatible strings in a VARIANT column: