I need to get result of sql query in JSON format via MSSQL 2014. I have wrote this code:
SELECT bc.Id, bc.CityName, bc.ProvinceId FROM BusCity AS bc WHERE bc.Country=2 FOR JSON AUTO
But I am getting an error:
Incorrect syntax near 'JSON'.
Is this possible? How to do this?