May 17, 2010 at 12:14 pm
Looking for t-sql to list last 2 times job failure
is anyone have it?
May 17, 2010 at 12:31 pm
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()...
May 17, 2010 at 1:56 pm
I want if last run of job failed then that date and time and same job when previously failed.
May 17, 2010 at 2:10 pm
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.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply