agent job failing with two steps

  • 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

  • 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

  • Hi John

    Yes first step is set to as suggested

    Is there anything else i could check?

  • 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

  • 13020

    21020

    0201204041337081

    2201204041337081

    2201204041334111

    0201204041334071

    1201204041334071

    0201204041332541

    2201204041332541

    2201204041331231

    1201204041331201

    0201204041331201

    2201204041329531

    0201204041329501

    1201204041329501

    2201204041327131

    0201204041327091

  • 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

  • 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.

  • 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

  • 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

Viewing 9 posts - 1 through 8 (of 8 total)

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