Log return value from exec sp in job agent (step) history?

  • Hi,
    I wonder if there's a quick way to have the return value from an EXEC stored-procedure Statement logged automatically in the Job steps history table...

    just before I construct my very own Tools 😉

    Thanks,
    Roer

  • DECLARE @Return int;
    EXEC @Return = MyProc;
    SELECT @Return; -- or try PRINT or RAISERROR

    John

  • I see, raising an exception could do the trick and produce an entry in the log...

  • --Deleted

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply