12

I created a maintenance plan for my SQL Server 2008 R2 using SQL Server Management Studio (SSMS).

However, I am unable to export/convert it to a script, in case I need to redo it on another server.

Is there a way?

If no, will there be a way with a newer version of SQL Server?

Hannah Vernon
  • 70,928
  • 22
  • 177
  • 323
carlo.borreo
  • 1,477
  • 6
  • 22
  • 37

2 Answers2

11

When you create job using maintenance plan, a job is automatically created in SQL Server Agent under Jobs. So now go to SQL Server Agent, expand jobs, and look for your job. Right click on it and select Script job as... Drop and recreate to... New query editor window.

Edit:

You can export the maintenance plans as well. You need to connect to Integration Services of the instance. Expand the stored packages then MSDB then expand Maintenance plans. Right click on MP and select a export package. Then you can move the package to another SQL Server.

David P
  • 103
  • 4
Shanky
  • 19,148
  • 4
  • 37
  • 58
0

Fastest way to move plans between servers is to connect from Management studio to server where plans are already confugured, start editing your plan and just copy\paste tasks between subplans. Though, this only works when connection between servers is working.

Nick
  • 1