How to Copy SQL Server Agent Jobs between Servers

Today I have to copy some SQL Server Agent Jobs from the Dev database to the test database.  Hmmm, I have got a lot of experience with SQL server agent jobs

I right clicked on the jobs and saw they were treated like sql stored procedure.  When you right clicked the job you can then choose Script Job as and then save CREATE To and then you can choose to either save it to a File and or New Query Editor Window.

So basically I saved it to a new query window, I then opened a query window on the Test database, ran the query and whammo, I had copied the job across.

I would like to add a word of warning, in my instance a lot of variables were still pointing at the old server, file directories and connections.  So you will have to be careful here, especially if you are doing this from test to live but of course you lto know that already.

if you want step by step instructions then I found this good article below which you can find here.  Although the article uses SQL Server 2005, it’s the same process I used on SQL server 2008

How To Copy SQL Server 2005 Jobs From One Server To Another

This example shows how to copy a scheduled backup job from one instance of SQL server 2005 to another.

In Microsoft SQL Server Management Studio, expand the SQL Server Agent tree.

Expand the jobs tree.

Here you will see a list of all the jobs currently stored on the server.

Right-click on the job that you want to copy over to a second server.
Select Script Job as –> Create To –> New Query Editor Window.

This will open a new window in the management studio containing auto-generated code.

Connect to the Second server, which will be the destination for the copied job.

Open up a new tab in the management studio – Copy the entire auto-generated code from the previous step and paste it into the new tab.

Below is the auto-generated code ready to execute on the new server.
Execute the whole code to continue.

Refresh and expand the Jobs tab on the second server, all being well the copied job will be displayed in the job list.

Right-click the job and select Properties to view the details.

You will see that the steps, schedules, alerts, notifications etc. will have been copied across. The job will now run on server 2 in the same way as it ran on server 1.

Advertisements

70-515 – Introduction to MVC 2 Videos

I have been studying the 70-515 .NET 4 Web Certification since the start of the year.  I am using a few different sources of information but the main one is the MCTS Self-Paced Training Kit (Exam 70-515): WEb Applications Development with Microsoft .NET Framework 4 book.  Yes I agree it’s a catchy title which they must have spent  a long time deciding on, well along time saying it that’s for sure.

This book is excellent, it describes things in an easy to understand way, the only complaint I have is it’s massive, I have worked out it’s 880 pages and today I have gone past the half way stage, yes I have read 441 pages.  If you would like to buy the book, get over to Amazon here

I am also watching some videos and today I watched a video on MVC 2, which features loads on the practise exam questions I have been testing myself with.  Before I watched the video I was terrible at the MVC 2 questions but I had to wait until round to learning it because there are loads of things to learn for the 70-515 exam.

I have to say my first impression of MVC 2 is it’s confusing and it seems like you have to put loads of configuration values in classes and within error prone “TEXT” strings.

I don’t think I fully understand it yet but my first look is it reminds me a bit of the Java framework Struts and Spring which used to filter messages to and from the backend to the frontend.  The beauty of Struts and Spring was you put all your mapping into xml files which seems easier to deal with because all the vales were in the same place.  You also had to create folders in correct locations, whilst I was watching the videos I thought it must be very difficult to bug fix an MVC 2 solution if you had done something wrong in the setup.

I can imagine that it would be quite complex if you had loads controllers and views

The first thing I have noticed is that I have started to understand the questions on my practise test.  I also noticed in a few places there is MVC 3, bloody hell I haven’t learnt MVC 2 yet.

So I thought I would give myself some homework to learn more about MVC 2 before I read the chapter on it and here are some links
http://channel9.msdn.com/blogs/matthijs/aspnet-mvc-2-basics-introduction-by-scott-hanselman

http://www.asp.net/mvc/videos/how-to-best-learn-asp-net-mvc

http://www.asp.net/mvc/videos/understanding-models-views-and-controllers

http://bradwilson.typepad.com/blog/2010/04/advanced-aspnet-mvc-2.html