Interesting behavior was noticed by me recently.
When the MS SQL stored procedure was started using SqlCommand.ExecuteScalar (), my application does not seem to be completely aware of any SQL errors or PRINT that appear after performing SELECT.
The most likely explanation is that flow control is transferred to C # immediately after the appearance of any SELECT result, without waiting for the stored procedure to complete (although the stored procedure continues to execute silently under it).
The obvious advantage is increased performance (no need to wait, as the result is already known), unfortunately, the C # application is not aware of any SQL exceptions that may occur after this point.
Can anyone confirm my explanation? Can this behavior be changed?
source
share