I have a SqlCommand
UPDATE table SET intColumn = intColumn + 1 WHERE id = @id
Is there a way to get the new value of intColumn in the same SqlCommand?
Something like
UPDATE table
SET intColumn = intColumn + 1
WHERE id = @id;
SELECT intColumn
with ExecuteScalar?
for example:
Dim x as int32 = sqlCommand.ExecuteScalar("sql")
and the x is the new value of the intColumn ?
The SQL query should be framed as below