i tired to Try return this format in SQL server using JSON_Query My Code Below ,i need to help my
i tired to Try return this format in SQL server using JSON_Query My Code Below ,i need to help my
i tired to Try return this format in SQL server using JSON_Query My Code Below ,i need to help my
[modifierGroups]=
ISNULL((
select
@modifierGroups as _id,
'General' as [name],
'' as [description],
[descriptionTranslations]=ISNULL((
SELECT * FROM sys.tables where 1=2
FOR JSON PATH ),'{}'),
[nameTranslations]=ISNULL((
SELECT * FROM sys.tables where 1=2
FOR JSON PATH ),'{}'),
'' as account, --requerd
[capacityUsages]=ISNULL((
SELECT * FROM sys.tables where 1=2
FOR JSON PATH ),'{}'),
cast(0 as int) as deliveryTax,
cast(0 as int) as eatInTax,
cast(0 as int) as takeawayTax,
'' as [location],
cast(0 as int) as [max],
cast(0 as int) as [min],
cast(1 as int) as [multiply],
@modifierGroups as plu,
[posCategoryIds]=ISNULL((
SELECT * FROM sys.tables where 1=2
FOR JSON PATH ),'[]'),
'' as posProductCategoryId,
'' as posProductId,
[productTags]=ISNULL((
SELECT * FROM sys.tables where 1=2
FOR JSON PATH ),'[]'),
cast(3 as int) as productType,
[subProducts]=ISNULL((
SELECT * FROM sys.tables where 1=2 --SELECT ir_item_remark_id FROM ItemRemarks
FOR JSON PATH ),'[]'),
'' as parentId,
cast(0 as bit) as snoozed,
[subProductSortOrder]=ISNULL((
SELECT * FROM sys.tables where 1=2
FOR JSON PATH ),'[]')
FOR JSON PATH ),'{}')
I need this format
"modifierGroups":{
"65********************31":{
"_id":"65********************31",
"name":"Cooking instructions",
"description":"",
"descriptionTranslations":{
},
"nameTranslations":{
"es":"Cocinado",
"fr":"Cuisson"
},
"account":"62********************f1",
"capacityUsages":[
],
"deliveryTax":9000,
"eatInTax":9000,
"takeawayTax":9000,
"location":"65********************32",
"max":1,
"min":1,
"multiply":1,
"plu":"MOD-01",
"posCategoryIds":[
],
"posProductCategoryId":"",
"posProductId":"",
"productTags":[
],
"productType":3,
"subProducts":[
"65********************32",
"65********************33",
"65********************34"
],
"parentId":"65********************30",
"snoozed":false,
"subProductSortOrder":[
]
},