JSON_MODIFY无法处理特殊字符'/'

时间:2017-09-05 11:10:01

标签: json sql-server-2016

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

0 个答案:

没有答案