Re: how to catch custom errors raised in SP gracefully?

From: Mary Chipman (mchip_at_online.microsoft.com)
Date: 07/13/04


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
>



Relevant Pages

  • Re: Need urgent help in Database update choice
    ... To differentiate data ... how does the server differentiate the updates ... >>> 2)In either choice of updates, the first time i connect to the server, ...
    (microsoft.public.sqlserver.ce)
  • Re: Need urgent help in Database update choice
    ... After a while a second update is made on the server(this update is added to ... the first publication), all three updates, how does the server knows that u1 ... and then to sql server using windows authentication. ... > differentiate them. ...
    (microsoft.public.sqlserver.ce)
  • Re: manipulating query strings
    ... i.e URL manipulation? ... > I know I can pass variables in URL to Server side script variables ... The server will differentiate between GET and POST, ...
    (Pen-Test)
  • New Master Shapes Bounding Box
    ... I've created a new "Serch Server" shape based on the nice isometric ... icon to differentiate it from eg web server or email ... grouping and ungrouping all the shape elements and I've tried amending ...
    (microsoft.public.visio)