October 11, 2013 at 2:05 am
Comments posted to this topic are about the item SQL Server Agent Jobs Statistics
October 11, 2013 at 6:27 am
Does not even compile
October 11, 2013 at 8:33 am
vesa.juvonen (10/11/2013)
Does not even compile
I've copied and pasted the script verbatim and was successful in executing on a SQL 2000 server against the msdb database.
October 11, 2013 at 1:12 pm
There is a small bug in the script :hehe: . Updated script will be published soon.
April 27, 2016 at 2:01 pm
Thanks for the script.
July 26, 2017 at 4:44 pm
The script is not working on SSMS 2016
July 26, 2017 at 5:40 pm
francesco.mantovani - Wednesday, July 26, 2017 4:43 PMThe script is not working on SSMS 2016
It looks like you are in master when you are executing the script. You would need to be in msdb.
Sue
July 26, 2017 at 5:47 pm
Sue_H - Wednesday, July 26, 2017 5:40 PMfrancesco.mantovani - Wednesday, July 26, 2017 4:43 PMThe script is not working on SSMS 2016It looks like you are in master when you are executing the script. You would need to be in msdb.
Sue
Yes, you were right, I was in a Master but then run the same script on a database and I received the same error
July 26, 2017 at 6:01 pm
francesco.mantovani - Wednesday, July 26, 2017 5:47 PMYes, you were right, I was in a Master but then run the same script on a database and I received the same error
I can get the error too if I'm not in msdb. The table is in the msdb databse. That is the database you need to be in when you execute it. At the beginning of the script, before the select, add the following before the select and then try executing it. It's doesn't pull all of the information correctly but it should run:
USE msdb
go
Sue
July 26, 2017 at 6:50 pm
Thank you
USE msdbUSE msdb
go
made the trick.
For make it easy to use I added after SELECT
DECLARE @DateFrom char(8) = '20170723' -- Set your start day range
DECLARE @DateTo char(8) = '20170725'-- Set your end day range
By the way I have uncommented, edited and added to the GROUP BY
sJobHis.run_time AS [Running_Time],
sJobHis.run_duration AS [Running_Duration],
But the result is unclear and not easy to understand. I mean the script is awesome but it doesn't show me the big picture:
Wouldn't be easier to show date like 'yyyy/mm/dd' and time like 'hh/mm/ss'?
Can you help me do that?
July 27, 2017 at 12:31 pm
Sue
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply