SQL JOB HISTORY Didn't show Step name. Shows only (job outcome)

  • Dear Experts,

    I need your help. please help me.

    I have maintain 9 SQL server 2008 as DBA. one of my server's jobs failed daily and i am going to view job history.

    where i found only step name (Job Outcome). i didn't see the the Step name step name is 'BC_CGW_Subscription_Retry'. we have seen (job outcome) and under this step name by default.

    why i am not seen step name.

    please help me to see the step name

    regards

    Neaz

  • Try with the below query

    Note : please replace job_name and step_name according to your code

    select

    j.name as 'JobName',

    s.step_id as 'Step',

    s.step_name as 'StepName',

    msdb.dbo.agent_datetime(run_date, run_time) as 'RunDateTime',

    ((run_duration/10000*3600 + (run_duration/100)%100*60 + run_duration%100 + 31 ) / 60)

    as 'RunDurationMinutes'

    From msdb.dbo.sysjobs j

    INNER JOIN msdb.dbo.sysjobsteps s

    ON j.job_id = s.job_id

    INNER JOIN msdb.dbo.sysjobhistory h

    ON s.job_id = h.job_id

    AND s.step_id = h.step_id

    AND h.step_id <> 0

    where j.enabled = 1 --Only Enabled Jobs

    and j.name like '%job_name%' --Uncomment to search for a single job

    and s.step_name like '%step_name%'

    order by JobName, RunDateTime desc

  • Thanks for your reply and effort. but my asking is not as your scripts. please PM me your email. I will give you my job history image. i can't upload my image here.

Viewing 3 posts - 1 through 2 (of 2 total)

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