ExecuteScalar vs ExecuteNonQuery when returning an identity value

As suggested by Aaron, a stored procedure would make it faster because it saves Sql Server the work of compiling your SQL batch. However, you could still go with either approach: ExecuteScalar or ExecuteNonQuery. IMHO, the performance difference between them is so small, that either method is just as “proper”. Having said that, I don’t … Read more