sql-server-maintenance-solution icon indicating copy to clipboard operation
sql-server-maintenance-solution copied to clipboard

Option to preface SQL Agent Job Names

Open ToddChitt opened this issue 3 years ago • 1 comments

I see that your jobs all fall into "Database Maintenance" category. But I wish SQL Agent would let us group jobs into folders in a visual way, like by Category. (I know, not your fault, just stating the facts here.)

I have taken to re-naming all the SQL Agent jobs the Maintenance Solution creates with something like "MAINT-" or similar so they all show up together in the list. But that does not survive when a later version comes along, I think. I suspect I am going to have two jobs, one named "CommandLog Cleanup" and one named "MAINT-CommandLog Cleanup". Now I have to delete old ones and re-name new ones with my prefix convention.

Asking if you can work in a "SQL Agent Job Name Prefix" type of parameter to handle this. But if there is a better way, some good work-around, I'm all ears.

Thanks for a great tool!

ToddChitt avatar Feb 03 '22 16:02 ToddChitt

Why not just script out renaming the job and have it run after you deploy the OLA Jobs? Something like: USE [msdb] GO EXEC msdb.dbo.sp_update_job @job_name=N'CommandLog Cleanup', @new_name=N'_MAINT_CommandLog Cleanup',@enabled=1 GO Can do this for all the jobs? Generally haven't seen many changes to the jobs themselves with updates, so when you go to update, just change the DECLARE @CreateJobs nvarchar(max) = 'Y' to 'N'

bwiggin10 avatar Apr 06 '22 19:04 bwiggin10