Skip to content
Advertisement

Parsing JSON from SQL Server

I have a table with the following columns, one column being a JSON blob. I’m unclear how to parse the JSON blob as a series of columns alongside the other columns. I know there’s something called OPENJSON, but not sure how to apply it to this case.

The json string example is below, from the DATA column above

Advertisement

Answer

openjson returns a table (possibly with many rows, although not for your sample).

To put something into a column you need a scalar. Try this example. Yes you need to explicitly list the columns out.

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