Check data is in JSON format in MS SQL Server
ISJSON is used to check the JSON value in MS SQL Server is valid or not. If the value is valid then it will return 1 otherwise 0.
Check the JSON value in MS SQL Server is a valid JSON value
-- JSON valid format
select isjson('{"id": "1"}') as Result
Result
------
1
--NON-JSON format
select isjson('abc') as Result
Result
-------
0
Check the column data with valid JSON format:
Check the invalid data in the column which does not contain JSON format data:
select docjson from customerdoc where isjson(docjson) = 0;