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

Trying to Read JSon string using SQL Query and OpenjSon

Hi 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 mentioned in the image, any help would be very helpful - thanks in advance. enter image description here