All Products
Search
Document Center

:When you use the OPENJSON function in SQL Server, the system prompts "Invalid object name 'openjson"

Last Updated:Dec 10, 2020

Problem description

When you use an OPENJSON function in apsaradb for RDS SQL Server, the following error is returned:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'openjson '.

New solution

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

You can run the following SQL statement to modify the compatibility level:

ALTER DATABASE [$Database_Name] SET COMPATIBILITY_LEVEL = [$NUM]

Note:

  • [$Database_Name] is the name of the database.
  • [$NUM] is the compatibility level. The specific compatibility level is subject to the actual environment.

Scope

  • ApsaraDB RDS for SQL Server