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


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 3:27 AM
Points: 652, Visits: 306
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


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 3:27 AM
Points: 652, Visits: 306
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: Monday, August 24, 2015 12:20 PM
Points: 1,064, Visits: 2,582
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
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 12:37 PM
Points: 3,028, Visits: 4,636
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)

"If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them." James Blackburn, in closing argument in the "Fatal Vision" murders trial
Post #1484001
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse