Solved

SQL Server Jobs

Posted on 2009-05-20
1
214 Views
Last Modified: 2012-05-07
Hi All,

I have two jobs job1 one server1 and job2 on server2. Both are running fine but I want to setup one job so that once the job1 on server1 is done, job2 on server2 is the next step and if everything failes I send an email saying one of the step has failed.

Thanks in advance for your help.

Cheers.
0
Comment
Question by:matrix_aash
1 Comment
 
LVL 8

Accepted Solution

by:
tpi007 earned 500 total points
ID: 24430001
You can do following:
  • Database Mail set up on both servers
  • Add linked server on server1 to server2
  • Add last step on server1 job as following
    • EXEC [server2].msdb.dbo.sp_start_job N'YourJobName'
    • Should have notification for email attched to job for 'When Job Completes' for info on server1 job
  • Add notification email to job on server2 as for 'When Job Completes'
    • Will provide info on server2 job  
I always have mail alerts set for when job completes so that you do not assume everything is good if your email system fails.
 

--Assumes your linked server name is server2
-- Replace 'YourJobName'  with valid job name
EXEC [server2].msdb.dbo.sp_start_job N'YourJobName' 

Open in new window

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question