We are receiving this JSON document and importing into SQL Server 2016 using Kingswaysoft JSON Source component
{
"Program": "USRMI",
"Transaction": "GetUserInfo",
"Metadata": {
"Field": [
{
"@name": "USERID",
"@type": "A",
"@length": 10,
"@description": "User"
},
{
"@name": "COMPNO",
"@type": "N",
"@length": 3,
"@description": "Company"
},
]
},
"MIRecord": [
{
"NameValue": [
{
"Name": "USERID",
"Value": "JOEBLO88"
},
{
"Name": "COMPNO",
"Value": "999"
},
],
"RowIndex": 0
}
{
"NameValue": [
{
"Name": "USERID",
"Value": "JOEBLO55"
},
{
"Name": "COMPNO",
"Value": "998"
},
],
"RowIndex": 1
}
]
}
and have a column in a table as follows:
{"Name": "USERID","Value": "JOBLO88"}
{"Name": "COMPNO","Value": "988"}
{"Name": "USERID","Value": "JOBLO55"}
{"Name": "COMPNO","Value": "955"}
I'm struggling to find any resource on syntax that can be used to convert this into a column structured table as per below
USERID COMPNO
====== ======
JOBLO88 988
JOBLO55 955