Home Forums Programming General Returning stored procedure messages via ADO RE: Returning stored procedure messages via ADO

  • Just did.  The catch is, the stored proc in question doesn't return any result sets normally. I've also tried just referencing the record count as well. 

    Create PROCEDURE q_test

    AS

    declare @e int, @a int

    begin transaction

      Set @a = 0

     

    RAISERROR ('AAAAAAAAAA', 17, 1)

    RAISERROR ('BBBBBBBBBB', 17, 1)

      Select 4 / @a

      Select @e = @@ERROR

      if @e <> 0 begin

           RaisError('The variable A should not be zero', 16, 1)

           Rollback

           Return(@e)

             end

       

    RAISERROR ('CCCCCCCCCCC', 17, 1)

    commit

    return(0)

    GO