JocaPC / sql-server-rest-api

Other
67 stars 16 forks source link

sql server version #1

Open cissemy opened 7 years ago

cissemy commented 7 years ago

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

jovanpop-msft commented 7 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Thank you. This way I do not need MongoDB.

On Wed, Oct 4, 2017 at 10:48 AM, Jovan Popovic notifications@github.com wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JocaPC/sql-server-rest-api/issues/1#issuecomment-334180405, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFUiWnxTSUImxQhZ_bfm2X3jJuYRHJoks5so5q6gaJpZM4MTH3y .

-- CISSE M. Y. Sofware/Web Developer Phone :(347) 443-9028

cissemy commented 6 years ago

Hi, I am trying to build the sample but i am getting the following error : attached file. Thanks

On Wed, Oct 4, 2017 at 10:48 AM, Jovan Popovic notifications@github.com wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JocaPC/sql-server-rest-api/issues/1#issuecomment-334180405, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFUiWnxTSUImxQhZ_bfm2X3jJuYRHJoks5so5q6gaJpZM4MTH3y .

-- CISSE M. Y. Sofware/Web Developer Phone :(347) 443-9028