Sql server T-SQL Json_修改函数
T-Sql JSON_MODIFY函数在添加新的值对(如Sql server T-SQL Json_修改函数,sql-server,tsql,Sql Server,Tsql,T-Sql JSON_MODIFY函数在添加新的值对(如 declare @jsonstring varchar(max) ='{"Width":"100%","Length":"45%"}' select JSON_MODIFY(@jsonstring,'append $.Height ','50%' ) --输出{“宽度”:“100%”,“长度”:“45%”,“高度”:[“50%”]} --正在添加包装我无法删除该包装 --预期输出{“宽度”:“100%”,“长度”:“45%
declare @jsonstring varchar(max) ='{"Width":"100%","Length":"45%"}'
select JSON_MODIFY(@jsonstring,'append $.Height ','50%' )
--输出{“宽度”:“100%”,“长度”:“45%”,“高度”:[“50%”]}--正在添加包装我无法删除该包装
--预期输出{“宽度”:“100%”,“长度”:“45%”,“高度”:“50%” 请尝试以下查询:
declare @jsonstring varchar(max) ='{"Width":"100%","Length":"45%"}'
select JSON_MODIFY(@jsonstring,'$.Height ','50%' )
报告说:
“可选修饰符,指定新值应附加到
JSON\u MODIFY
两次