question

phllle avatar image
phllle asked

How to convert JSON Array column in a table to a relational format?

I Want use OPENJSON or a something to convert JSON Array Column into relational format? with column 'DSN' and 'inaccessiblePlaceIds'. As you can see column 'inaccessiblePlaceIds' is a JSON array, so I am looking to show their DSN and the observation from 'inaccessiblePlaceIds'. Example. One DSN could have multiple 'inaccessiblePlaceIds'. Basically want to change the array into rows

sqlserver2012json
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Can you post the example data as text rather than an image

0 Likes 0 ·

1 Answer

·
harbingergroup avatar image
harbingergroup answered

Below link will help you. if not please share the example data instead of image.


https://docs.microsoft.com/en-us/sql/relational-databases/json/convert-json-data-to-rows-and-columns-with-openjson-sql-server?view=sql-server-ver15#:~:text=The%20OPENJSON%20rowset%20function%20converts,into%20a%20SQL%20Server%20table.


10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.