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
- How can I programmatically check (parse) the validity of a TSQL statement?
- What represents a double in sql server?
- How to pass an array into a SQL Server stored procedure
- Generate class from database table
- What size do you use for varchar(MAX) in your parameter declaration?
- Call a stored procedure with parameter in c#
- ExecuteReader requires an open and available Connection. The connection’s current state is Connecting
- Connection timeout for SQL server
- The SqlParameter is already contained by another SqlParameterCollection – Does using() {} cheat?
- MultipleActiveResultSets=True or multiple connections?
- Calling stored procedure with return value
- Insert 2 million rows into SQL Server quickly
- How do I obtain a list of all schemas in a Sql Server database
- How do I return multiple result sets with SqlCommand?
- TransactionScope Prematurely Completed
- Which sql server data type best represents a double in C#? [duplicate]
- ADO.NET – The Size property has an invalid size of 0
- How to run multiple SQL commands in a single SQL connection?
- Can I save an ‘Object’ in a SQL Server database?
- Passing List to SQL Stored Procedure
- SQL error: Incorrect syntax near the keyword ‘User’
- How to pass sqlparameter to IN()? [duplicate]
- C# Equivalent of SQL Server DataTypes
- Can you get the column names from a SqlDataReader?
- How to get the connection String from a database
- Under what circumstances is an SqlConnection automatically enlisted in an ambient TransactionScope Transaction?
- Is it necessary to manually close and dispose of SqlDataReader?
- Changing SqlConnection timeout
- What’s the best way to test SQL Server connection programmatically?
- How to monitor SQL Server table changes by using c#?
- How to directly execute SQL query in C#?
- What is the equivalent SQL Server type for the C# long type?
- How do you Sort a DataTable given column and direction?
- DateTime.MinValue and SqlDateTime overflow
- Passing Output parameters to stored procedure using dapper in c# code
- SQL Server: Isolation level leaks across pooled connections
- SQL Query slow in .NET application but instantaneous in SQL Server Management Studio
- What’s better: DataSet or DataReader?
- Keyword Not Supported: Metadata
- What’s the fastest way to bulk insert a lot of data in SQL Server (C# client)
- SQLite Database Locked exception
- EF 6.1 Unique Nullable Index
- EF Exception: String or binary data would be truncated. The statement has been terminated.?
- How can I add user-supplied input to an SQL statement?
- How to test if a DataSet is empty?
- Why does Dapper’s .Execute(…) return an int?
- Pass table valued parameter using ADO.NET
- How to insert a record and return the newly created ID using a single SqlCommand?
- How should I multiple insert multiple records?