I have a table that only have one column and the records are in json format as shown below:

The sample of each row is:
{
"id": "51cf9ff0-0ed5-11eb-8887-53248e3b2424",
"attributes": {
"source": "Google",
"medium": "cpc",
"visit_route": [
{
"time_on_page": 5,
"page_title": "Dedicated Servers"
},
{
"time_on_page": 1,
"page_title": "Partner Programme"
}
],
"keyword": null,
"visit_length": 6,
"started_at": "2020-10-15T10:56:31.51Z",
"ga_client_ids": [
"1213599109.1602733400"
],
"lead_id": "597b4cd6-d8fb-11e6-adad-17d0cee77142_ayRRmwDGKhjjSgdcMGDMGf"
}
}
The outcome should look like below:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|id |source |medium |visit_route |Keyword|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|51cf9ff0-0ed5-11eb-8887-53248e3b2424 |Google |cpc |[{"time_on_page": 5,"page_title": "Dedicated Servers"},{"time_on_page": 1,"page_title": "Partner Programme"}]| Null |
This sample is in each rows. I am new to parsing json in sql and have tried using the script below:
select id ,
attributes
from [StageDB].[dbo].[LeadFeeder_visits_json]
cross apply openjson(jsonObj)
WITH (
id nvarchar(100) ,
attributes nvarchar(max)
)
But the result I got as shown below:
I really need help.

