Quantcast
Channel: SQL Server - How to transform JSON to Relational database - Stack Overflow
Viewing all articles
Browse latest Browse all 4

SQL Server - How to transform JSON to Relational database

$
0
0

How can we use SQL to Convert a JSON statement into different tables?For example we have JSON:

{"table1":    {"Name":"table1","Items":         [{"Id":1,"FirstName":"John","LastName":"Wen","Country":"UK","PostCode":1234,"Status":false,"Date":"2018-09-18T08:30:32.91",}]},"table2":     {"Name":"table2","Items":        [{"Id":1,"Name":"leo","StudentId":102,"CreatedDate":"2018-09-18","Location":"USA"}]}}

In the relational database, we will get two tables once the JSON is convertedFor example, schema 'Table1':

Id  FirstName  LastName  Country  PostCode  Status   Date1   John       Wen       UK       1234      false    2018-09-18T08:30:32.91

And the 'Table2' will look like:

Id   Name   StudentId   CreateDate    Location 1    Leo    102         2018-9-18     USA

Could anyone please give any advices on it.


Viewing all articles
Browse latest Browse all 4

Trending Articles