By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
DECLARE @json NVARCHAR(MAX) = N'[
{
"id": 2,
"info": {
"name": "John",
"surname": "Smith",
"age": 25
}
},
{
"id": 5,
"info": {
"name": "Jane",
"surname": "Smith",
"skills": [
{
"name": "SQL",
"group": "SQLnerds"
},
{
"name": "C#",
"group": "C#nerds"
},
{
"name": "Azure",
"group": "Azurenerds"
}
]
},
"dob": "2005-11-04T12:00:00"
}
]';
SELECT v.id,
v.firstName,
v.lastName,
id | firstName | lastName | age | dateOfBirth | singleskill | skills | skillstring |
---|---|---|---|---|---|---|---|
2 | John | Smith | 25 | null | null | null | null |
5 | Jane | Smith | null | 2005-11-04 12:00:00.0000000 | SQL | [ { "name": "SQL", "group": "SQLnerds" }, { "name": "C#", "group": "C#nerds" }, { "name": "Azure", "group": "Azurenerds" } ] |
SQL,C#,Azure |