json - OPENJSON 在 Azure SQL DB 中无法识别

标签 json sql-server azure-sql-database

我想在 Azure SQL DB 中使用 OPENJSON 函数,但是当我尝试执行该函数时,出现以下错误:

Msg 195, Level 15, State 10, Line 25 'OPENJSON' is not a recognized built-in function name.

我研究并发现了这个 link

The OPENJSON function is available only under compatibility level 130 or higher. If your database compatibility level is lower than 130, SQL Server can't find and run the OPENJSON function. Other JSON functions are available at all compatibility levels.

按照建议,检查与以下的兼容性级别

select * from sys.databases

并确认为 140,高于最低要求。

那么,它不会起作用吗?

最佳答案

OPENJSON 是一个表值函数,它必须出现在表表达式的有效位置。

select openjson('{}')

失败

Msg 195, Level 15, State 10, Line 29 'openjson' is not a recognized built-in function name.

但是

select * from openjson('{}')

有效。

关于json - OPENJSON 在 Azure SQL DB 中无法识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54882009/

相关文章:

json - 在postgres中将jsonb转换为jsonb数组

sql-server - Node.js 和 Microsoft SQL Server

sql-server - 我如何知道距离用完所有 SQL Azure 计算资源还有多远?

sql - 如何手动删除 SQL Azure 数据同步对象

javascript - 无法读取 JSON 字符串

json - 解码json以构造结构时如何设置默认值

python - 将 Python 列表(JSON 或其他)插入 MySQL 数据库

sql-server - 如何从 Azure 函数应用连接到我的 SQL Server?

.net - VS2017 Entity Framework 无法为此请求检索数据

sql - 无法连接到 Azure SQL 服务器,错误 :