Converting nested Json document to SQL data

  • I have response from a API that look like

    {

    "responseCode": 200,

    "message": "success",

    "content": [

    {

    "id": "1234578",

    "form_id": "9v5648148",

    "created_at": "2023-01-31 14:54:37",

    "status": "ACTIVE",

    "answers": {

    "1": {

    "name": "name",

    "order": "2",

    "sublabels": "{\"prefix\":\"Prefix\",\"first\":\"First Name\",\"middle\":\"Middle Name\",\"last\":\"Last Name\",\"suffix\":\"Suffix\"}",

    "text": "Name",

    "type": "control_fullname",

    "answer": {

    "first": "First",

    "last": "LastTest"

    },

    "prettyFormat": "First LastTest"

    },

    "2": {

    "name": "10Digit1234",

    "order": "3",

    "text": "Enter Control number",

    "type": "control_textbox",

    "answer": "1234567809"

    }

    },

    {

    "id": "5510025870127903",

    "form_id": "9v56481481",

    "created_at": "2023-01-31 14:29:47",

    "status": "ACTIVE",

    "updated_at": null,

    "answers": {

    "1": {

    "name": "name",

    "order": "2",

    "sublabels": "{\"prefix\":\"Prefix\",\"first\":\"First Name\",\"middle\":\"Middle Name\",\"last\":\"Last Name\",\"suffix\":\"Suffix\"}",

    "text": "Name",

    "type": "control_fullname",

    "answer": {

    "first": "Test1",

    "last": "Test2"

    },

    "prettyFormat": "Test Test2"

    },

    "2": {

    "name": "10Digit1234",

    "order": "3",

    "text": "Enter Control number",

    "type": "control_textbox",

    "answer": "11111111"

    }

    }

    ],

    "duration": "235.75ms",

    "resultSet": {

    "offset": 0,

    "limit": 20,

    "count": 20

    },

    "limit-left": 9990

    }

     

    how do i convert this to SQL table data..

     

     

  • Sorry, but that's not valid JSON.

    Generally, what most people do, is to flatten the structured JSON into one table, which can later be queried and grouped.

    Alternatively you can also use for example an SSIS script component to deserialize it into several output tables, that reflect the structure of the JSON input. But generally that's a more involved process.

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply