当我运行它时,我会得到一个错误,如何考虑这个值可能是null,并且它不会抛出一个错误?
declare @Concepts varchar(500)
set @Concepts = '{"Concepts":null}';
select [value] from openjson(@Concepts,'strict $.Concepts')当它不是空的时候
set @Concepts = '{"Concepts": [4324,2342]}';这就是我要犯的错误
JSON引用的值不是数组或对象,不能用OPENJSON.打开。
发布于 2019-01-16 15:28:34
我想把字符串'strict'从'strict $.Concepts'中拿出来解决了我的问题
declare @Concepts varchar(500)
set @Concepts = '{"Concepts":null}';
select [value] from openjson(@Concepts,'$.Concepts')https://stackoverflow.com/questions/54219836
复制相似问题