sql-server-maintenance-solution
sql-server-maintenance-solution copied to clipboard
Option to preface SQL Agent Job Names
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!
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'