I am looking for a query with the native functions of SQL Server 2012 to extract the JSON from the column Value, and dynamically create columns, and I want to do this for different columns
I have multiple record
| ID | Data | Other |
| 122 | {"URL":"www.url.com","Icon":"some_icon","Facebook":"Fa_url"} | Test123 |
| 222 | {"URL":"www.url.com","Icon":"some_icon", Facebook":"Fa_url"} | test123 |
I need to this formate
| id | URL | Icon | Other | ||
| 122 | www.abc.com | Some_icon | Facebook_url | abc | test123 |
| 222 | www.abc.com | Some_icon | Facebook_url | abc | test123 |

Bryian TanPosted Jul 5, 2018, 12:51 AM
arvind baldaniyaPosted Jul 4, 2018, 7:23 AM
Shrimant TelgavePosted Jul 4, 2018, 6:50 AM
Solution-1:
only you need to change the column name in the above query.
I hope this will help you to resolved your problem.
arvind baldaniyaPosted Jul 4, 2018, 2:58 AM
arvind baldaniyaPosted Jul 4, 2018, 2:42 AM
Gajanan ChavhanPosted Jul 4, 2018, 2:11 AM
Also I found similar links :
1) https://www.red-gate.com/simple-talk/blogs/sql-server-json-to-table-and-table-to-json/
2) https://stackoverflow.com/questions/33520910/transform-json-data-to-separate-columns
arvind baldaniyaPosted Jul 4, 2018, 2:06 AM
Gajanan ChavhanPosted Jul 4, 2018, 1:55 AM
https://docs.microsoft.com/en-us/sql/relational-databases/json/convert-json-data-to-rows-and-columns-with-openjson-sql-server?view=sql-server-2017