I found a suggestion online that this was some sort of a compilation error. Why isn't this error caught by the BEGIN TRY? Why does this error occur? The evaluation of JSON_VALUE should not take place because ISJSON should be 0 and therefore the row is filtered from the results. Unexpected character 'z' is found at position 0. Results: Msg 13609, Level 16, State 2, Procedure TestJSONParseProc, Line 10 Now I want to use this function in a procedure and feed it the same bad JSON: CREATE OR ALTER PROCEDURE nvarchar(max) Importantly, it will not error when the JSON is not well-formatted. It will return "Bad JSON" when the JSON is not well-formatted. Consider the below function which returns a portion of a well-formatted JSON object.
0 Comments
Leave a Reply. |