BUG: Error Handler Not Called by RAISERROR if NOCOUNT Set ON
Article ID: 152135
Article Last Modified on 11/14/2003
APPLIES TO
- Microsoft SQL Server 4.21a Standard Edition
- Microsoft SQL Server 6.0 Standard Edition
- Microsoft SQL Server 6.5 Standard Edition
This article was previously published under Q152135
SYMPTOMS
When executing a stored procedure that raises an error through RAISERROR,
the error handler in the DB-Library application is not called if NOCOUNT is
set ON within the stored procedure. The message handler is always called
correctly, but the calling of the error handler depends on the NOCOUNT
behavior.
WORKAROUND
Set NOCOUNT OFF before calling the RAISERROR in the stored procedure, and
then set NOCOUNT back ON after the RAISERROR.
STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server
versions 6.5, 6.0 and 4.21a. We are researching this problem and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
Additional query words: dblib proc
Keywords: kbbug KB152135