all groups > sql server dts > march 2007 >
You're in the

sql server dts

group:

How do I create a script to add the maintenance plans to sql serve


How do I create a script to add the maintenance plans to sql serve victoria
3/21/2007 9:16:08 AM
sql server dts:
I have been looking to see if anyone has written a script to create the
maintenance plans in SQL 2005. The previous commands like
sp_add_maintenance_plan have all been depreciated. It appears Microsoft don't
want you to script the creation. By having it scripted makes it easier to
ensure the plans are set up the same on all servers and less time consuming
to install.

I tried the option of exporting and import however this doesn't work in so
far as it doesn't appear to keep the local connection or the databases
selected in the plan e.g., msdb or all user databases. It would be much
quicker to be able to run this as part of the auto install.

It appears to use this dll Microsoft.SqlServer.MaintenancePlanTasks.dll and
other scripts I have seen runing the backend are
sp_dts_getfolder
sp_dts_addfolder
sp_dts_deletefolder
sp_dts_renamefolder
sp_dts_listfolders
sp_dts_getpackage
sp_dts_putpackage
sp_dts_deletepackage
sp_dts_listpackages
sp_dts_getpackageroles
sp_dts_setpackageroles

Does anyone have ideas on how to script out the maintenance plan creation?
Re: How do I create a script to add the maintenance plans to sql serve narayaana
3/21/2007 6:00:30 PM
maintenance plans are now SSIS (former DTS) packages,
open SSIS, this tool will enable you to create packages that you can then
deploy to any server.

[quoted text, click to view]

Re: How do I create a script to add the maintenance plans to sql s narayaana
3/22/2007 12:00:00 AM
[quoted text, click to view]

Not sure if this is clear to me. I use SSIS to create and deploy maintenance
plans and do not have particular issues (vars are kept), it is no more than
10 minutes to produce. Maybe could you send me an example of what you do in
more details? (direct email)

Looking into the msdb system table, making it in sql scripts does not look
possible anymore.

Re: How do I create a script to add the maintenance plans to sql s victoria
3/22/2007 1:26:08 AM
I realize they are part of SSIS but creating them manually within SSIS is
very time consuming. Just creating one on the server then exporting it to
another is not very useful as I have found that all the core content is lost
and only the blank tasks are moved.

[quoted text, click to view]
AddThis Social Bookmark Button