If I execute the following query in I-SQL
SELECT top 2 Identifier id, Description Text
FROM Tax
order by id for json raw
I get the following result:
[{"id":1,"Text":"AEU Domestic delivery GB"},{"id":2,"Text":"AEU Domestic delivery BE"}]
That's what I expect.
However if I use this query as a subquery in another query:
SELECT
(SELECT top 2 Identifier id, Description Text
FROM Tax
order by id for json raw) as result,
(if (select count() from Tax) > 2 then 'True' else 'False' endif) as more
for json raw
I get the following result:
[{"result":"[{\"id\":1,\"Text\":\"AEU Domestic delivery GB\"},{\"id\":2,\"Text\":\"AEU Domestic delivery BE\"}]","more":"True"}]
How do I get rid of these '\'. I wasn't expecting them.
Regards,
Frank