Header add

In this article we will learn How to Fix “Invalid object name 'OPENJSON' in SQL Server.

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.


OpenJson SQL


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;

openjson-sql-issue-resolve


How to Check the Compatibility Level of the Database

SELECT compatibility_level
FROM sys.databases
WHERE name = 'Your_DataBaseName';

OpenJson Compatibility

Summary
In this tutorial we discussed How to Fix Invalid object name OPENJSON in SQL Server. If have any question related to this topic then give your feedback.

Post a Comment

Previous Post Next Post