0

I have an instance of SQL Server running Microsoft SQL Server 2017 (RTM-CU31) (KB5016884) - 14.0.3456.2 (X64)

In one database, if I use JSON functions I get the following error:

Invalid object name 'OPENJSON'

But in another database on the same instance, I can use JSON functions with no problem.

I guess there's some setting that allows JSON functions?

Thom A
  • 88,727
  • 11
  • 45
  • 75
user1707389
  • 99
  • 1
  • 4
  • 13
  • 5
    What is the compatibility level of the database? *"If your database compatibility level is lower than 130, SQL Server can't find and run the OPENJSON function."* [OPENJSON (Transact-SQL)](https://learn.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16) – Thom A Apr 27 '23 at 12:54
  • This may help identify the lower compatibility levels --- SELECT name,compatibility_level FROM sys.databases – John Cappelletti Apr 27 '23 at 13:36
  • I checked with oldest your version is okay,do you sure your version is 2017? can you test query is in this site on your sql server? https://dbfiddle.uk/ExrSoL-s? – abolfazl sadeghi Apr 27 '23 at 14:52

0 Answers0