You want the OUTPUT clause
UPDATE Items SET Clicks = Clicks + 1
OUTPUT INSERTED.Name
WHERE Id = @Id
Related Contents:
- Use of SqlParameter in SQL LIKE clause not working
- WHERE IN (array of IDs)
- ExecuteReader requires an open and available Connection. The connection’s current state is Connecting
- How to pass an array into a SQL Server stored procedure
- Call a stored procedure with parameter in c#
- Insert 2 million rows into SQL Server quickly
- Calling stored procedure with return value
- Remove weird characters ( A with hat) from SQL Server varchar column
- How do I return multiple result sets with SqlCommand?
- Return value from SQL Server Insert command using c#
- How to pass sqlparameter to IN()? [duplicate]
- What represents a double in sql server?
- Passing List to SQL Stored Procedure
- SqlConnection SqlCommand SqlDataReader IDisposable
- SqlBulkCopy from a List
- SQL command INSERT is working but the data not appear in table
- SQL error: Incorrect syntax near the keyword ‘User’
- ado.net Closing Connection when using “using” statement
- Connection timeout for SQL server
- MultipleActiveResultSets=True or multiple connections?
- How to give ADO.NET Parameters
- Using SqlDataAdapter to insert a row
- How to run multiple SQL commands in a single SQL connection?
- How can I retrieve a list of parameters from a stored procedure in SQL Server
- What size do you use for varchar(MAX) in your parameter declaration?
- Creating a SQL Server table from a C# datatable
- Generate class from database table
- Add WHERE clauses to SQL dynamically / programmatically
- Pass Array Parameter in SqlCommand
- Execute Insert command and return inserted Id in Sql
- Execute a large SQL script (with GO commands)
- How to monitor SQL Server table changes by using c#?
- C# Equivalent of SQL Server DataTypes
- OleDbCommand parameters order and priority
- Adding multiple parameterized variables to a database in c#
- How can I insert 10 million records in the shortest time possible?
- Invalid attempt to read when no data is present
- Writing Recursive CTE using Entity Framework Fluent syntax or Inline syntax
- How to execute an SSIS package from .NET?
- SqlBulkCopy Insert with Identity Column
- What’s better: DataSet or DataReader?
- How to deploy application with sql server database on clients
- How to insert a data table into SQL Server database table?
- Is there any difference between DateTime in c# and DateTime in SQL server?
- Can’t access my SQL Server via C# form application from client device
- SQLException : String or binary data would be truncated
- The variable name ‘@’ has already been declared. Variable names must be unique within a query batch or stored procedure
- Is there an Entity Framework 7 Database-First POCO Generator?
- Reverse engineering SSIS package using C#
- When executing a stored procedure, what is the benefit of using CommandType.StoredProcedure versus using CommandType.Text?