If you encounter error Msg 208, Level 16 “Invalid object name ‘OPENJSON’.”, you are probably trying to use the OPENJSON() function on a database with a compatibility level of less than 130.
OPENJSON() is only available under compatibility level 130 or higher.
To fix this, either increase the compatibility level of your database to 130 or higher, or change to a database that already has the appropriate compatibility level.
So the solution is Run the below statement following your database.
Syntax:
ALTER DATABASE DataBaseName
SET COMPATIBILITY_LEVEL = 150;
SELECT compatibility_level
FROM sys.databases
WHERE name = 'Your_DataBaseName';
Post a Comment