I am using MSSQL 2008 and i need help exporting data from the database to a JSON file. The following is the code i have used to store the JSON file to the MSSQL 2008 Database.
The code above saves the JSON data in the database table. Now i need the code that can export that data back to a JSON file, in a specified path when i call it. The JSON file should look like this :
Kindly help. Been on this for days now.
Code:
SELECT *
FROM OPENROWSET (BULK 'C:\FilesTest\Dump\sample1.JSON', SINGLE_CLOB) as j
Code:
{
"status": true,
"detail": "Verification Successful",
"data": {
"Number": "000001900019",
"Batchnumber": "677899 444404",
"Linked": "9",
"FullName": "Tuoyo Dante",
"Gender": "Male",
"LinkedEmail": null,
"PerformanceSummary": [
{
"BALANCE": "0",
"AMOUNT": "EUR 0",
"OVERDUE_AMOUNT": "0"
},
{
"BALANCE": "0",
"AMOUNT": "EUR 2,000",
"OVERDUE_AMOUNT": "0"
},
{
"BALANCE": "8,256",
"AMOUNT": "EUR 6,350,020",
"OVERDUE_AMOUNT": "0"
}
]
}
}