Site icon Database Tutorials

JSON text is not properly formatted

If you are processing JSON data and the JSON data is not a valid JSON below error will be occurred.

Msg 13609, Level 16, State 7, Line 13

JSON text is not properly formatted. Unexpected character is found at position.

Be sure that the JSON data is correct. You can check whether its correct or not using ISJSON function. You can find detailed information about JSON functions in the article named “JSON Functions in SQL Server(TSQL)

For Example execute the below script. As you can see an error will be occured.

If you change the JSON data as below, the problem will be corrected.

You can find online json formatter to check your json is valid on the web.

In addition you can find usefult json examples on article JSON Comment Tutorial with Examples

Exit mobile version