Showing posts with label executed. Show all posts
Showing posts with label executed. Show all posts

Thursday, March 22, 2012

Alert gets executed, but not its job. Am I doing something wrong?

I have an Alert that I verify gets activated (looked at its history under the General Tab) but it never executes the Execute Job under the Response tab.

Here is what I did:

1) Checked the Execute Job box
2) Created a job
a) Gave it a name
b) Gave it an owner
c) Left the category as Uncategorized
d) Under the Steps tab added a new step
i) Gave the step a name
ii) Selected Operating System Command (CmdExec) as the type
iii) In the Command box typed the following

cd C:\Blat
blat StandardMessage.txt -to Test.Test@.MyURL.com -s "TEST"
cd C:\

When I copy and paste that EXACT message (cd...blat...cd...) on the command line it works perfectly so it looks like the job isn't getting executed at all.

I also tried to set up an output file (under the Advanted Tab...Operating System Command. That file never gets created either! That makes me REALLY sure the job isn't getting executed.

So, if my Alert gets executed as verified by the history, why isn't my job being kicked off?

THANKS!what account the service is running under? probably system account. you need to have a domain account with minimal rights.|||Originally posted by ms_sql_dba
what account the service is running under? probably system account. you need to have a domain account with minimal rights.

You have lost me here.

My Alert executes just fine. I don't see any way to specify any "account" for the job that gets kicked off to run under.

Where should I look to specify the "account the service is running under"?

Thanks.|||Originally posted by darrinps
You have lost me here.

My Alert executes just fine. I don't see any way to specify any "account" for the job that gets kicked off to run under.

Where should I look to specify the "account the service is running under"?

Thanks.

I THINK what is happening is that the command I want to execute is local to my PC and the exec is attempting ro tun against the local server box.

What I need to do is either install the software there, or better yet (for testing) somehow redirect it to my box.|||try copying all the command line steps in a .bat file and then run that bat file from your scheduler.

Tuesday, March 20, 2012

Alert for a job step

hi.
I have a job with 5 steps.
I want a custom alert after the first step is executed reagrdless of whether it succeeds or fails on execution. I want to do a net send of the alert only after step1 is completed. How do i do this?
Thank you very much for the help.You can create step 2 as the send alert and go to that step on both success and failure.

You can also call your step step 2
Create step 1 as a failure alert step
Create step 3 as a success alert step
Start the job at step 2 and goto step 1 on failure, step 3 on success.
Step 1 and step 3 can call an SP to send the alert.|||thank you for the reply. Appreciate your responses and help in this forum.
Yes, I have made a custom error message/code and an custom alert for that error code.
And all i do is raiserror with the custom error code passed as parameter in the job step. this is captured by the alert and the net send is generated. By the way how do i send an alert from an SP?:confused: