Skip to content
Advertisement

SQL server: How to Modify a JSON element value in a nested JSON array

If i have below JSON (@CarDataJsontest) e.g

If i need to do is to modify the car911 to car2 all i have to do is below

Now I have a JSON @CarDataJson which is something like below

What do I need to do now to modify the car911 to car2?

Because using below Query

i just get an error.

Unexpected character ‘[‘ is found at position X

Advertisement

Answer

Thanks to @JeroenMostert ‘s comment

If I have a JSON @CarDataJson which is something like below

All I need to do to modify the car911 to car2 is

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement