Results 1 to 2 of 2

Thread: Trapping cmdexec errors

  1. #1
    alan Guest

    Trapping cmdexec errors

    I would like to trap a return value from a cmdexec that is scheduled. The cmdexec returns 0 if it is a success and something other than 0 if it doesn't.

    Can I raise an error from a command file. The command file calls a console application ( i.e. no interface ).

    Any help is appreciated.

  2. #2
    Ray Miao Guest

    Trapping cmdexec errors (reply)

    On 11/11/98 1:52:32 PM, alan wrote:
    > I would like to trap a return value from a cmdexec that is scheduled. The
    > cmdexec returns 0 if it is a success and something other than 0 if it
    > doesn't.

    Can I raise an error from a command file. The command file
    > calls a console application ( i.e. no interface ).

    Any help is appreciated.
    You can find this in msdb..systasks_view. If the task is success, the value of lastruncompletionlevel is 1. What you can do is that create a sql script to check this value, if it's 0 then raise an error. In the command file, call console app first, then call isql to run the script.

Posting Permissions

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