I have a .NET stored procedure that, among other things, uses SqlCommand.ExecuteNonQuery to do an UPDATE statement, but the method is returning -1.
The MSDN help for ExecuteNonQuery states: "For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. ... For all other types of statements, the return value is -1. If a rollback occurs, the return value
is also -1."
The Update statement is perfectly valid; if I execute the statement within the Management Studio instead of calling the stored procedure, it works fine - I correctly get "(70 row(s) affected)". And I'm not using transactions, so I don't think a rollback
should be occurring.
Can anybody shed some light on this?
Thanks in advance.
View Complete Post