Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    268

    Unanswered: Stored Procedure Question

    Hi All,

    I have a stored procedure that I want to execute within a job step. If the stored procedure fails how can I send the message back so the job step will fail as well? Because if the job step fails I get notified. Thanks.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    within the sp you can always do a...

    IF @@ERROR > 0
    EXEC xp_sendmail ...
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Or you could use RAISERROR (). See BOL for the details.

    -- This is all just a Figment of my Imagination --

  4. #4
    Join Date
    Jul 2004
    Posts
    268
    Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •