Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

agent job failing with two steps Expand / Collapse
Author
Message
Posted Wednesday, April 4, 2012 6:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 11:13 AM
Points: 9, Visits: 38
Hello everyone

I have an agent job with two steps,

when i run the top step it completes with the second not running at all.

But if i run the agent job specifing the second step to run

That also completes. Is there something obvious i can check?

Kind Regards

Rob
Post #1277986
Posted Wednesday, April 4, 2012 7:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 5,429, Visits: 10,094
Rob

Check that the first step not configured to "quit the job reporting success" when it succeeds. You need it to be configured to "go to the next step".

John
Post #1277999
Posted Wednesday, April 4, 2012 7:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 11:13 AM
Points: 9, Visits: 38
Hi John

Yes first step is set to as suggested

Is there anything else i could check?
Post #1278016
Posted Wednesday, April 4, 2012 7:33 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 5,429, Visits: 10,094
Rob

Please run these two queries and post the results:

SELECT
s.step_id
, s.on_success_action
, s.on_success_step_id
, s.on_fail_action
, s.on_fail_step_id
FROM
msdb..sysjobs j
JOIN
msdb..sysjobsteps s
ON
j.job_id = s.job_id
WHERE
j.name = '<Job_Name>'

SELECT TOP (15)
h.step_id
, h.run_date
, h.run_time
, h.run_status
FROM
msdb..sysjobs j
JOIN
msdb..sysjobhistory h
ON
j.job_id = h.job_id
WHERE
j.name = '<Job_Name>'
ORDER BY
run_date DESC
, run_time DESC

John
Post #1278050
Posted Wednesday, April 4, 2012 7:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 11:13 AM
Points: 9, Visits: 38
1 3 0 2 0
2 1 0 2 0


0 20120404 133708 1
2 20120404 133708 1
2 20120404 133411 1
0 20120404 133407 1
1 20120404 133407 1
0 20120404 133254 1
2 20120404 133254 1
2 20120404 133123 1
1 20120404 133120 1
0 20120404 133120 1
2 20120404 132953 1
0 20120404 132950 1
1 20120404 132950 1
2 20120404 132713 1
0 20120404 132709 1
Post #1278056
Posted Wednesday, April 4, 2012 7:56 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 5,429, Visits: 10,094
Rob

From those results, it looks as if step 2 runs every time the job runs - for the last five executions, certainly. What makes you think step 2 isn't running after step 1 runs?

John
Post #1278081
Posted Wednesday, April 4, 2012 8:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 11:13 AM
Points: 9, Visits: 38
Each step is a seperate ssis package. and each package has data flow and email tasks.

Both data flow extract data out to a csv file. Then sent out via email.

I am included on both the emails.
Post #1278098
Posted Wednesday, April 4, 2012 8:18 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:46 AM
Points: 5,429, Visits: 10,094
Then your package is not working properly, or maybe the e-mail that you don't get is filtered out by Mimesweeper or whatever you have on your mail system. Perhaps something that happens in the first package stops the second package from sending the e-mail. But if you look in the job history, you'll see that step 2 runs every time.

John
Post #1278104
Posted Wednesday, April 4, 2012 2:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 9, 2014 11:13 AM
Points: 9, Visits: 38
I understand what you are saying,

but both packages run when i specify them seperately via agent job.

ie i recieve all emails. very strange
Post #1278396
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse