Trapping Errors in Stored Procedures

Trapping Errors in Stored Procedures

Post by Brian Dia » Sat, 01 May 1999 04:00:00

I have a stored procedure that is being executed by an insert trigger to
send notifications using xp_sendmail.  If xp_sendmail fails, an error is
raised and travels all the way back to the ADO object that originally made
the insert.

How can I trap the xp_sendmail errors in the stored proc so they don't make
it back to the ADO Connection?

Your help is greatly appreciated,
Brian Dial
Intergraph Corp.
Marshall Space Flight Center


1. Trapping errors from stored procedure calls

We often use code in stored procedures for premature exit, such as

        RAISERROR( 'Whoopsie in sub-module 3 - error %d',


Another program detects that this has happened as follows:

        RAISERROR( 'Whoopsie in StoredProcedure - error %d',


I am wondering if this instead should be, for instance,

        RAISERROR( 'Whoopsie invoking StoredProcedure - error %d',


        RAISERROR( 'Whoopsie during StoredProcedure - error %d',


- i.e., is our current style liable to miss some errors?

(For instance, invalid parameters, before StoredProcedure even runs?)


3. Trapping Errors in Stored Procedures

4. discontinued support for sql7?

5. Trap errors with Store Procedures in SQL WS 6.5

6. sdfg

7. trapping errors in stored procedures (newbie)

8. More Info on DBMS Crash

9. Trapping error inside stored procedure using ON EXCEPTION

10. Trap Entended stored procedure errors in DBLIB

11. FW: trap informix store procedure errors!

12. Error trapping in stored procedure

13. Stored Procedure Error Traps