t-sql to list last 2 times job failure

  • Looking for t-sql to list last 2 times job failure

    is anyone have it?

  • The requirement is not clear. Do you want to list only jobs where the last run and the one before failed, job that have failed twice (as per available log entries), the two most recent failures or something different?

    Anyway, sp_help_jobhistory will most probably give you the results you requested. Maybe together with ROW_NUMBER()...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • I want if last run of job failed then that date and time and same job when previously failed.

  • rpatil22 (5/17/2010)


    I want if last run of job failed then that date and time and same job when previously failed.

    So, I guess sp_help_jobhistory together with ROW_NUMBER() will help here. Please give it a try and post back if you have further questions. Please include the sample code you're struggling with.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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