question

Sharma avatar image
Sharma asked

Sub plan name is not updating in maintenance plan.

I am executing given below query to update the maintenance plan sub-plan name and description and query is executed successfully and return message with 1 row updated but when I check the entry in table it only change the description and not changing the sub-plan name. Please let me know if there is any constraint which is not allowing changing the name with query however I am able to change the name through management studio successfully. > UPDATE sp SET > sp.subplan_name='Rebuild_Index',sp.subplan_description='RebuildIndex_UpdateStatistics' > from msdb..sysmaintplan_subplans sp > inner join msdb..sysmaintplan_plans p > on p.id = sp.plan_id inner join > msdb..sysjobs j on sp.job_id = > j.job_id Inner JOin > msdb..sysssispackages ps on ps.id > = p.id where j.[enabled] = 1 And p.name='MaintenancePlan_Performance'
sql-server-2008maintenance-plans
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sharma avatar image Sharma commented ·
I am surprised that no input on this.
0 Likes 0 ·

1 Answer

·
RichardTheLionHeart avatar image
RichardTheLionHeart answered
use msdb.[dbo].[sp_maintplan_update_subplan]
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.