Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Trigger JOBS Expand / Collapse
Author
Message
Posted Thursday, August 1, 2013 12:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 7:40 AM
Points: 5, Visits: 22
how to trigger a job after completion of another job in sql server management studio 2005

I have two JOBS A and B in JOB Activity monitor

I want to trigger JOB B automatically after completion of JOB A
Post #1479795
Posted Thursday, August 1, 2013 12:48 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 2:57 AM
Points: 487, Visits: 258
Do you need two jobs? You can put JOB A as the first step and JOB B as the second step in one job?
Post #1479799
Posted Thursday, August 1, 2013 1:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 7:40 AM
Points: 5, Visits: 22
How to create two jobs into one?
Post #1479812
Posted Thursday, August 1, 2013 2:49 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 2:57 AM
Points: 487, Visits: 258
Open the properties of the first job.

Select the Steps page.

Click New to add a step containing the second job.
Post #1479831
Posted Friday, August 2, 2013 8:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 28, 2014 12:50 PM
Points: 1,061, Visits: 2,580
sandosh.star (8/1/2013)
how to trigger a job after completion of another job in sql server management studio 2005

I have two JOBS A and B in JOB Activity monitor

I want to trigger JOB B automatically after completion of JOB A


Add a step of type "Transact-SQL script (T-SQL)" to the end of Job A. In the "Command" window for that step, enter a statement that executes the sp_start_job system stored procedure for Job B. See here for info on sp_start_job:

http://msdn.microsoft.com/en-us/library/ms186757(v=sql.90).aspx


Jason Wolfkill
Blog: SQLSouth
Twitter: @SQLSouth
Post #1480423
Posted Tuesday, August 13, 2013 3:18 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 3:44 PM
Points: 2,266, Visits: 3,419
Assuming the account running "JobA" has the authority to start jobB, the command in JobA would be:


EXEC msdb.dbo.sp_start_job 'JobB'




SQL DBA,SQL Server MVP('07, '08, '09)

Carl Sagan said: "There is no such thing as a dumb question." Sagan obviously never watched a congressional hearing!
Post #1484001
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse