DECLARE @json NVARCHAR(4000)
DECLARE @VAL NVARCHAR(4000)
SET @json =
N'{
"info":{
"type":1,
"address":{
"town":"Bristol",
"county":"Avon",
"country":"England"
},
"tags":["Sport", "Water polo"]
},
"type":"Basic"
}'
SET @VAL='123'
SELECT @json = JSON_MODIFY(@jSON,'$.type',CONCAT('Metro','/',@VAL))
SELECT @json
SELECT CONCAT ( 'Metro ', '/', @VAL ) AS Result;
====================================
JSON_Modify返回类型为 - Metro \ / 123但它应该返回为Metro / 123