I am having two tables STUDENT and MASTER as follows
CREATE TABLE student(sid int,sname varchar(10),saddress varchar(30))
CREATE TABLE master(mid int,mname varchar(10),maddress varchar(30))
Now I want the JSON Structure as
{
"student": [
{
"sid": "value",
"sname": "value",
"saddress": "value"
}
],
"master": [
{
"mid": "value",
"mname": "value",
"maddress": "value"
}
]
}
In short I can say:
{
"table1":[],
"table2":[]
}
I have tried this but result is not as expected
SELECT * FROM student,master FOR JSON AUTO
Can any one help me to form the required JSON Structure from the query ??