October 8, 2003 at 7:18 am
One way is to use RETURN to return non sql critical errors or user defined errors and to trap both errors after proc call
DECLARE @Result int,@ERR int
EXECUTE @Result = proc1 param,param,param...
SET @ERR = @@ERROR
IF (@ERR > 0)
--critical error
ELSE
IF @Result > 0
--non critical / user defined error
Far away is close at hand in the images of elsewhere.
Anon.
October 8, 2003 at 10:14 am
Thank you, something I'll add to my toolset for capturing both sets of errors.
I suggested a similar approach to the application developer, catching the @@ERROR and using both return and raiserror, however, the java driver is not handling it as a sql exception. With further testing, it appears that it has to do with the driver not parsing the error if a result set is also returned - this therefore does not garnner us a sql exception for the java to catch and handle. We are escalating to the driver vendor, I'll post our findings on the chance that someone else encounters this in the future.
October 8, 2003 at 10:22 am
Can you use an OUTPUT parameter in the top proc to return either error value (@ERR or @Result in my example) and test for this.
Far away is close at hand in the images of elsewhere.
Anon.
October 8, 2003 at 11:43 am
Very possibly, I suggest they try that.
Viewing 4 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply