Tuesday, January 19, 2016

Update a row and returning a value with one query - SQL

This will return single value which is updated
Inside can return multiple value also

You want the OUTPUT clause

UPDATE data SET count = count + 1
OUTPUT INSERTED.count
WHERE Id = @Id

No comments:

Post a Comment

Integrating OpenAI / ChatGPT in ASP.NET Core Web API

 This guide shows how to build a production-ready AI API using ASP.NET Core with: Clean Architecture, streaming responses, database storage,...