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


SQL Server Agent Schedule Decoder


SQL Server Agent Schedule Decoder

Author
Message
abair34
abair34
SSC-Enthusiastic
SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)

Group: General Forum Members
Points: 129 Visits: 316
Comments posted to this topic are about the item SQL Server Agent Schedule Decoder
c.masca
c.masca
Valued Member
Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)

Group: General Forum Members
Points: 55 Visits: 39
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.
liebesiech
liebesiech
Old Hand
Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)

Group: General Forum Members
Points: 342 Visits: 863
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
Attachments
SQLServerAgentScheduleDecoder.txt (35 views, 15.00 KB)
randal.schmidt
randal.schmidt
Valued Member
Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)

Group: General Forum Members
Points: 61 Visits: 120
Thanks. I got the same error. The corrected script works great.
tskelley
tskelley
SSC-Enthusiastic
SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)SSC-Enthusiastic (191 reputation)

Group: General Forum Members
Points: 191 Visits: 1176
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.



abair34
abair34
SSC-Enthusiastic
SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)SSC-Enthusiastic (129 reputation)

Group: General Forum Members
Points: 129 Visits: 316
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
Tom Winter
Tom Winter
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 85
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
liebesiech
Old Hand
Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)Old Hand (342 reputation)

Group: General Forum Members
Points: 342 Visits: 863
liebesiech thank you for getting that fixed for me.

Thanks to you for sharing this script! :-D
deanroush
deanroush
SSC Journeyman
SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)

Group: General Forum Members
Points: 84 Visits: 265
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.
TerryS
TerryS
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1017 Visits: 1460
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.



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