<p>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. </p>

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

<p>Edit</p>

<p>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. </p>

[{'answer_id': 32714, 'author': 'Martin', 'author_id': 770, 'author_profile': 'https://Stackoverflow.com/users/770', 'pm_score': 3, 'selected': True, 'text': "<p>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:</p>\n\n<p>Connect to Integration Services and expand Stored Packages>MSDB>Maintenance Plans. You can then right click on the plan and select import or export</p>\n"}, {'answer_id': 32722, 'author': 'Martin Marconcini', 'author_id': 2684, 'author_profile': 'https://Stackoverflow.com/users/2684', 'pm_score': 0, 'selected': False, 'text': "<p>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). </p>\n\n<p>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. </p>\n\n<p>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.</p>\n"}]
['https://Stackoverflow.com/questions/32689', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/978/']