Wednesday, 29 April 2015

How to delete Maintenance plan when you get error message “Exception has been thrown by the target of an invocation (mscorlib)


Use MSDB


Step 1:
Execute the below query to obtain the Maintenance plan name and Id
SELECT NAME, ID FROM MSDB..SYSMAINTPLAN_PLANS

Step 2:
Replace the Id obtained from Step 1 into the below query and delete the entry from log table
DELETE FROM SYSMAINTPLAN_LOG WHERE PLAN_ID=' '

Step 3:
Replace the Id obtained from Step 1 into the below query and delete the entry from subplans table as shown below,
DELETE FROM SYSMAINTPLAN_SUBPLANS WHERE PLAN_ID = ' '

Step 4:
Finally delete the maintenance plan using the below query where ID is obtained from Step1
DELETE FROM SYSMAINTPLAN_PLANS WHERE ID = ' '

No comments:

Post a Comment