This query works perfect
SELECT * FROM application_info WHERE id IN (20002, 20001)
However when I add FOR JSON PATH
I get a json
that is invalid and the data is incomplete.
SELECT * FROM application_info WHERE id IN (20002, 20001) FOR JSON PATH
An example of the json
I am getting back is below. Notice how it just ends abruptly. Obviously the FOR JSON PATH
is causing the error as the query without it works just fine. What am I doing wrong?
[{
"id": 20002,
"app_status": "Active",
"true_up": "Yes"
}, {
"id": 20001,
"app_status": "Active",
"true_up": "Yes"
}, {
"id": 20002,
"app_status": "Inactive",
"true_up": "Yes"
}, {
"id": 20002,
"app_status": "Active",
"true_up": "Yes"
}, {
"id": 20002,
"app_status": "Inactive",
"true_
Sample table data application_info
id app_status true_up
-----------------------------------
20003 Active Yes
20002 Active Yes
20004 Active Yes
20003 Active Yes
20001 Active Yes
20002 Active Yes
20002 InActive Yes
20003 Active Yes
20005 InActive Yes
20002 Active Yes
20002 Active Yes
20003 Active Yes
20001 Active Yes
20002 Active Yes