in reply to Trapping Stroed Proc errors with MSSQL

You need to tell SQL Server to NOT return a "x rows affected" message, using SET NOCOUNT ON.

ALTER PROC SP_DAVE AS BEGIN SET NOCOUNT ON -- << ADD THIS LINE update mytable set st = getdate() where date = getdate(); if @@rowcount != 0 begin RAISERROR ('No Rows !!',16,1); RETURN -1; end RETURN 0; END;

 

Replies are listed 'Best First'.
Re^2: Trapping Stroed Proc errors with MSSQL
by Anonymous Monk on Jul 23, 2004 at 08:45 UTC
    Thanks

    This is it !! Perl was reading thru all the system messages and hence missing the error message if it was other than first.

    Thanks for everyones help