SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SCOME - Part 3: The Failed Jobs Report


SCOME - Part 3: The Failed Jobs Report

Author
Message
Drew Salem
Drew Salem
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 172
Hi Gary,

I'm guessing that the reason this is happening is because one of your jobs has never been run, or under last_run_time/date there is something other than dates such as "Unknown"? I'll modify the script to handle this, but in the mean time, just give that job a dummy run date. The problem will only appear the first time you create a job and it has never been run. You can give it a dummy run either by doing so in the system table or by telling SSMS that the job should report Success on Failure. Then run it, then change it back to Success on Succeed. This can be done in the advanced tab of the job.
Drew Salem
Drew Salem
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 172
I have sent article part 4 to SQLServerCentral. It may be weeks before it is published though, so I have also published it at thebuddingdba.com. This part is an indepth but very concise introduction to Visual Studio, .Net and how to display the FailedJobs report in a browser. It can be accessed here.
gary.dunn
gary.dunn
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 113
Thanks Drew, I think I'll have to wait for your code change, as I can't change the users jobs on the servers. Please let me know when you've made the code change.

Thanks!

Gary
gary.dunn
gary.dunn
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 113
I was able to create my web page! Thanks Drew!

Gary
Drew Salem
Drew Salem
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 172
gary.dunn (5/12/2009)
I was able to create my web page! Thanks Drew!

Gary


Great!
gary.dunn
gary.dunn
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 113
Drew, I've added a bunch of servers and except for convert issue, it's going great....except for one server I'm getting this error when I run usp_getfailedjob:

Msg 207, Level 16, State 1, Line 3
Invalid column name 'originating_server'.

Any idea why this one server has this error and the others are fine?

Thanks,

Gary
Drew Salem
Drew Salem
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 172
gary.dunn (5/12/2009)
Drew, I've added a bunch of servers and except for convert issue, it's going great....except for one server I'm getting this error when I run usp_getfailedjob:

Msg 207, Level 16, State 1, Line 3
Invalid column name 'originating_server'.

Any idea why this one server has this error and the others are fine?

Thanks,

Gary


What SQL Server version and edition is it? It seems that SQL Server cannot find this column in one of the two system tables. Do you permission on your server to browse the system table columns?
gary.dunn
gary.dunn
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 113
My mistake, the SQL version is 2005 but I specified in the server_sql_details table that it is a 2000. I changed the value from 8 to 9 and it now works....thanks!
DBA_Oshvegas
DBA_Oshvegas
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 250
Drew - Great script!

However, similar to Gary I am also getting the conversion error:

Msg 241, Level 16, State 1, Line 2
Conversion failed when converting datetime from character string.



When I bracket and quote the named instance like: ['SERVERNAME\INSTANCENAME'] the SP runs successfully but no failures appear in the table. The weird thing is this works perfectly on my test server but not prod, both are 2005 with no differences that I am aware of.

Any ideas?

BTW, the job that failed is not a new job, has been run daily for a few months now. Thanks!!
DBA_Oshvegas
DBA_Oshvegas
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 250
Drew,

Never mind on this. I just ran a select statement using a convert statement for the datetime and for whatever reason, still got the error. I rewrote this job with some other scripts I previously wrote and was able to get something very similar to what you wrote here on the site.

Anyway, keep up the good work. Your scripts and articles definitely get me going in a direction to improve database processes for my company. Thanks for helping us think outside the box!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search