Skip to content
Advertisement

How to split a string which contains delimiter into multiple rows using OPENJSON function

I am trying to split the below string using OPENJSON function in SQL Server 2019:

But the result is returned as:

enter image description here

I want to display it as this:

enter image description here

Thanks

Advertisement

Answer

This is where my thinking brings me.

Note: Unexpected results of the "'s are NOT balanced.

Example or dbFiddle

Results

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