Thursday, January 13, 2011

SQL Server 2005: Copy SQL Server Agent Job?

I have a SQL Server Agent job comprised of 10 steps and each step has many parameters defined. Now I need another job almost exactly the same, but with a few differences. Since "copy / paste" isn't an option for jobs, I'm looking for suggestions on what would be the best way to create a new job based on the first.

Edit: I just noticed that I can right-click and "Script Job As". I suppose one option would be to do just that and edit the script for my changes. I'm still curious as to if there are any other (better?) options as well.

  • I don't think there is a better option than scripting your job. You can modify the script as required and reapply it to any number of SQL instances (always backup your system databases before apply scripts).

    Chris_K : This seems to be the best way to go when copying jobs in the same instance.
  • You may find the SQL Server Integration Services Task, Copy Job to be of use.

    http://msdn.microsoft.com/en-us/library/ms137568(SQL.90).aspx

    Chris_K : I had looked at that, but it doesn't seem to help me copy a task on the same instance. I guess I could copy from instance a to instance b, rename and modify and then copy back but with my ADD issues I'm sure to lose track of what I'm doing halfway through! :-)

0 comments:

Post a Comment