SQL-How to get value of updated column

There are times you would like to update a column in a table and return the value of the updated column . Here's how to do it :


UPDATE Employee SET Salary = Salary + 1 OUTPUT INSERTED.Salary WHERE Employee_ID = 2

The key here for displaying the value is 'OUTPUT INSERTED.Salary'




Previous
Next Post »
1 Komentar
avatar

This was helpful .Thanks

Balas

ASP.NET - How To Display Animated .GIF On Postback

When designing an interactive web page, it is important for you to let the user know that  an action initiated by him/her is in progress.One...