I am trying to insert a value in my existing JSON by using inbuilt JSON functions in SQL Server.
Existing JSON:
{
"array": [
{
"type": "_api",
"content": {
"acId": "sometext/567890"
}
}
]
}
SET @JSONData = JSON_MODIFY(@JSONData,'$.array[0].content.uId ', 'sometext/1234/locations/1234')
But the resulted value inserted in JSON is coming as shown below.
I need it to come as sometext/1234/locations/1234
but it got added as sometext\/1234\/locations\/1234
.
{
"array": [
{
"type": "_api",
"content": {
"acId": "sometext/567890",
"uId": "sometext\/1234\/locations\/1234"
}
}
]
}
1条答案
按热度按时间qybjjes11#
Encapsulate your JSON_MODIFY with replace function to the incorrect characters: