TRY_PARSE_JSON
functionsupportedCore SQL functionsA special version of PARSE_JSON that returns a NULL value if an error occurs during parsing.
Syntax
supportedpartialnot supportednot scored
TRY_PARSE_JSON( <expr> [ , '<parameter>' ] )
Parameters
| Name | Required | Description |
|---|---|---|
expr | required | An expression of string type (for example, VARCHAR) that holds valid JSON information. |
'parameter' | optional | String constant that specifies the parameter used to search for matches. Supported values: Parameter Description d Allow duplicate keys in JSON objects. If a JSON object contains a duplicate key, the returned object has a single instance of that key with the last value specified for that key. s Don’t allow duplicate keys in JSON objects (strict). This value is the default.ExpandShow lessSee more |
Returns
Returns a value of type VARIANT that contains a JSON document. If the input is NULL or if an error occurs during parsing, the function returns NULL. This function doesn’t return a structured type.
Usage notes
- See PARSE_JSON for the usage notes.