How to return a single table


This is the default behaviour when returning a single table, and is the same as setting the ResponseDataMode to "Json1".

Return single row and single column

Query

SELECT 'Hello World' as Data

Output

[
    {
        "Data": "Hello World"
    }
]

Return multiple columns

Query

SELECT 'Hello' as Data1, 'World' as Data2

Output

[
    {
        "Data1": "Hello"
        ,"Data2": "World"
    }
]

Return multiple rows and columns

Query

SELECT FirstName, LastName FROM People

Output

[
    {
        "FirstName": "John"
        ,"LastName": "Doe"
    },
    {
        "FirstName": "Jane"
        ,"LastName": "Doe"
    }
]
Last updated: 15 oct 2015

Give us feedback

AngularJS <-> Microsoft SQL

Exchange data between your AngularJS application and your Microsoft SQL Server