Arshad Mehmood

Search the blog

    Today I Learned

    Return results in json

    sql

    The following works for MS SQL Server:

    SELECT *
    FROM Table 
    where id = 1
    FOR JSON AUTO, Without_Array_Wrapper;

    Result:

    {"id":1,"name":"test"}