In SQL Server 2005/2008, the functionality of the maintenance plan is accomplished through SSIS packages. If you accidentally delete the maintenance Plans folder in SSIS Management, you will have problems setting up the maintenance plan in SQL Server, as shown in the following illustration.
Create the maintenance Plans folder that was mistakenly deleted in Management Studio, as shown in the following illustration.
After you have established the "Maintenance Plans" folder, you can establish a maintenance plan normally, but the established maintenance plan is not displayed, and you can find the appropriate SSIS package under SSIS's Maintenance Plans folder.
This problem occurs because the Maintenance Plan Wizard stores a maintenance plan's SSIS package based on the folder name, but the maintenance plan obtains a script for the maintenance plan related to the SSIS package by querying the View "Sysmaintplan_plans" to see its contents
EXEC msdb.. Sp_helptext ' Sysmaintplan_plans '
CREATE VIEW Sysmaintplan_plans
As
SELECT
...
From
Msdb.dbo.sysssispackages as S
WHERE
(S.folderid = ' 08aa12d5-8f98-4dab-a4fc-980b150a5dc8 ' and s.packagetype = 6)
As you can see from the view script, the view uses the FolderID instead of the name to get the content, our new "Maintenance plans" folder is basically not the ID, so update this view to refer to the correct folder ID, the normal folder IDs can be obtained by performing the following query.
SELECT *
From Msdb.dbo.sysssispackagefolders--SQL 2005 table name: SYSDTSFOLDERS90
WHERE foldername = N ' maintenance plans '
and Parentfolderid = ' 00000000-0000-0000-0000-000000000000 '