I have a stream from IoT Hub like:
{
"store_id": "111",
"data": [
{
"timestamp": "2018-04-06T11:46:11.842305",
"book_id": "001",
"author_id": "101"
},
{
"timestamp": "2018-04-06T11:46:11.842306",
"book_id": "002",
"author_id": "102"
},
{
"timestamp": "2018-04-06T11:46:11.842307",
"book_id": "003",
"author_id": "103"
}
]
}
I want to pass this stream in a SQL DB like this:
id id_type timestamp
001 book_id 2018-04-06T11:46:11.842305
101 author_id 2018-04-06T11:46:11.842305
002 book_id 2018-04-06T11:46:11.842306
102 author_id 2018-04-06T11:46:11.842306
003 book_id 2018-04-06T11:46:11.842307
103 author_id 2018-04-06T11:46:11.842307
is there any way to use cross apply
or other way to create two new columns form multi json element