我想在 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/