In MS SQL Server 2005, is there a way to export, the complete maintenance plan of a database as a SQL Script?

StackOverflow https://stackoverflow.com/questions/32689

  •  09-06-2019
  •  | 
  •  

Question

Currently, if I want to output a SQL script for a table in my database, in Management Studio, I can right click and output a create script.

Is there an equivalent to output an SQL script for a database's maintenance plan?#

Edit

The company I work for has 4 servers, 3 servers and no sign of integration, each one running about 500,000 transactions a day. The original maintenance plans were undocumented and trying to create a default template maintenance plan.

Was it helpful?

Solution

You can't export them as scripts, but if your intention is to migrate them between server instances then you can import and export them as follows:

Connect to Integration Services and expand Stored Packages>MSDB>Maintenance Plans. You can then right click on the plan and select import or export

OTHER TIPS

I don't think you can do that with Maintenance Plans, because those are DTS packages, well now they are called SSIS (SQL Server Integration Services).

There was a stored procedure from which you could add maintenance plans, but I think that it may be deprecated. (sp_add_maintenance_plan). I don't have a SQL 2005 to test here.

The question is, why would you want to export the complete mp? :) If it's for importing in other server, then a ssis package could be useful. I suggest you take a look in that direction, because those you can export/import among servers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top