Skip to main content
The 2024 Developer Survey results are live! See the results
3 of 7
Removed image

Trying to read JSON string using SQL Query and OpenJson

I have a very large JSON string, I am trying to read using SQL for some report, but the JSON has objects embedded within in at least couple of levels, can somebody please suggest me how can I read all the Data using one SQL query using OpenJson.

I tried in the following way

DECLARE @json NVarChar(max) = (select top 1 Blob from Vehicles where Entity='Case' and EntityId=20)
 
SELECT * FROM OpenJson(@json);

but its giving me data in the format shown in the image, any help would be very helpful - thanks in advance.