Re: how to catch custom errors raised in SP gracefully?
From: Mary Chipman (mchip_at_online.microsoft.com)
Date: 07/13/04
- Next message: Mike Labosh: "Re: Fitch & Mathers"
- Previous message: William \(Bill\) Vaughn: "Re: how to catch custom errors raised in SP gracefully?"
- In reply to: Bob: "how to catch custom errors raised in SP gracefully?"
- Next in thread: Bob: "Re: how to catch custom errors raised in SP gracefully?"
- Reply: Bob: "Re: how to catch custom errors raised in SP gracefully?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 14:00:03 -0400
One way to handle it is to use output parameters instead of RAISERROR
to handle both server and user-defined errors. Raising exceptions is
always expensive, and coding your stored procedures to minimize
sending error messages back and forth across the wire is a good idea.
Anything that can be handled on the server should be, and the client
should get back a clear success/failure message for every operation
performed so that it can branch accordingly.
--Mary
On Tue, 13 Jul 2004 12:44:21 -0500, " Bob" <bobatkpmg@yahoo.com>
wrote:
>In my stored procedure, I raise an error using RAISERROR. Seems it just
>comes out to the .NET code as a SqlException. Is there a way to
>differentiate my custom error from the raw SqlExceptions (like table is
>missing, FK violation etc), because if I purposely raise an error, I sure
>want to handle it differently.
>
>Thanks
>Bob
>
- Next message: Mike Labosh: "Re: Fitch & Mathers"
- Previous message: William \(Bill\) Vaughn: "Re: how to catch custom errors raised in SP gracefully?"
- In reply to: Bob: "how to catch custom errors raised in SP gracefully?"
- Next in thread: Bob: "Re: how to catch custom errors raised in SP gracefully?"
- Reply: Bob: "Re: how to catch custom errors raised in SP gracefully?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|