Following query returns whole table as single JSON string (list of JSON objects - one per row):
SELECT * FROM MyTable FOR JSON AUTO
I need to return multiple rows where each row will be a JSON string of a signle row of the table.
For example if table fields are A,B,C output should be:
{A: <value>, B: <value>, C: <value>}
{A: <value>, B: <value>, C: <value>}
{A: <value>, B: <value>, C: <value>}
...
{A: <value>, B: <value>, C: <value>}
How to do this in TSQL ?
While it's possible to construct JSON strings by hand by concatenating strings, I'd prefer to reuse existing tool that would handle cases like quotes in values.