Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql server version #1

Open
cissemy opened this issue Mar 4, 2017 · 5 comments
Open

sql server version #1

cissemy opened this issue Mar 4, 2017 · 5 comments

Comments

@cissemy
Copy link

cissemy commented Mar 4, 2017

Hi,
Can sql-server-rest-api work on sql server 2014 or before ?

@jovanpop-msft
Copy link

Yes, since it is just a wrapper around ADO.NET. However, note that the functions that generates OData and JQuery DataTable responses as JSON rely on FOR JSON clause that is available only in SQL2016.

@cissemy
Copy link
Author

cissemy commented Oct 4, 2017

Hi,
In your rest api you only implemented R part of CRUD:
// GET api/People/Load
[HttpGet("Load")]
public async Task Load()
{
await sqlQuery.Stream("select * from people for json path", Response.Body, "[]");
}
How to implement Create and Update and Delete?

@JocaPC
Copy link
Owner

JocaPC commented Oct 4, 2017

You can a create stored procedure that parses input JSON using OPENJSON and insert it into a table. Take a look at SQL Server GitHub samples:

Instead of stored procedure, you can directly embed the SQL in code.

@cissemy
Copy link
Author

cissemy commented Oct 4, 2017 via email

@cissemy
Copy link
Author

cissemy commented Oct 13, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants