SQL Server Agent Schedule Decoder

  • Comments posted to this topic are about the item SQL Server Agent Schedule Decoder

  • Thanks for the script - it lists scheduling info, but lists the job name as is. Would it be possible to also 'decrypt' the job name, somehow. we have a large number of reporting-services-generated jobs whose name are gibberish. It would be great if the job name could be translated to show the name of the RS schedule that the job represents. So far, I have been unable to decipher this type of job names.

  • Great script but gives me an error.

    Msg 102, Level 15, State 1, Line 12

    Incorrect syntax near '?'.

    I pasted the whole query into my Notepad++ and there I could see what the problem was:

    SELECT SJ.name as job_name

    , SJ.enabled as is_job_enabled

    , SS.enabled as is_schedule_enabled

    /*, ISNULL(SJ.description, '') as job_desc*/

    , SS.name as schedule_name

    , CASE freq_type

    ????WHEN 1 THEN 'Occurs on ' + STUFF(RIGHT(active_start_date, 4), 3,0, '/') + '/' + LEFT(active_start_date, 4) + ' at '

    ????????+ REPLACE( RIGHT(CONVERT(varchar(30),

    So I got rid of the question marks, let SQL Refactor do the layout and it worked like a charm!

    Probably a problem related to my setup but just in case somebody else has the same problem I attached the script.

    Cheers :smooooth:

  • Thanks. I got the same error. The corrected script works great.

  • Thanks, great script. And yes, SQL 2005 or higher. I am one of those dinosaurs that still defaults to SQL2000 to keep customer backward compatibility.

    As for the formatting, I also paste into Notepad++, then just do a Replace All on four question marks (????) with four spaces and that does the trick. Something to do with the HTML code control. The interesting thing is pasting into MS Word handles the question marks, but includes the HTML control in the document, so you still have to copy the code out of the control to make it more readable.

  • liebesiech thank you for getting that fixed for me. For some reason when I submitted it to SQLServerCentral the control they use for the submission seems to have taken my tabstops and turned them into some nasty unicode character. I noticed it when I went to view source on the page. I don't know if there is any way for me to clean up the script on the main page. In any case thanks for taking the time to fix it!

    -Michael Abair

  • Very nice script. Thank you. Would have loved to have had this two weeks ago when I was documenting our schedules by hand.

    I had the same problem copy and pasting the code into SSMS, but I just did a search and replace and then it worked.

  • liebesiech thank you for getting that fixed for me.

    Thanks to you for sharing this script! 😀

  • Very nice! It is great to have useful little scripts like this. We create procs from scripts like this and add them to our UTIL schema to make it easy to find and use them from SSMS.

    Thanks for sharing.

  • c.masca (1/6/2010)


    Thanks for the script - it lists scheduling info, but lists the job name as is. Would it be possible to also 'decrypt' the job name, somehow. we have a large number of reporting-services-generated jobs whose name are gibberish. It would be great if the job name could be translated to show the name of the RS schedule that the job represents. So far, I have been unable to decipher this type of job names.

    You could join job_name to ScheduleID in the Schedule table in the ReportServer database to retrieve Name and EventType.

  • tskelley (1/6/2010)


    Thanks, great script. And yes, SQL 2005 or higher. I am one of those dinosaurs that still defaults to SQL2000 to keep customer backward compatibility.

    As for the formatting, I also paste into Notepad++, then just do a Replace All on four question marks (????) with four spaces and that does the trick. Something to do with the HTML code control. The interesting thing is pasting into MS Word handles the question marks, but includes the HTML control in the document, so you still have to copy the code out of the control to make it more readable.

    For SQL 2000, try this script, been kicking around awhile, from mssqltips.com

    Gaby________________________________________________________________"In theory, theory and practice are the same. In practice, they are not." - Albert Einstein

  • How would I do this since there is already a JOIN to sysschedules? Sorry, I am not a system DBA.

  • Try This...

    IT is written ASSUMING your reporting services database is named REPORTSERVER

    and its COLLATION for the name column in the catalog table is Latin1_General_CI_AS_KS_WS

    Let me know if it works for you.

    -Michael Abair

  • Perfect! Thanks for a very cool solution and the mods to make it workable for me.

  • Excellent script! Keep up the great work!

    Question for you. Would you know if you can display the length of each job too? I would be nice to see how long the job took to complete from the start time.

    This would make a good addition and you could then collect this information from all your server to ensure of jobs are overlapping in their execution.

    Rudy

    Rudy

Viewing 15 posts - 1 through 15 (of 20 total)

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