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 01, 2013 12:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 01, 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 01, 2013 12:48 AM


SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, January 31, 2014 2:56 AM
Points: 483, Visits: 256
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 01, 2013 1:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

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


SSC-Addicted

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

Group: General Forum Members
Last Login: Friday, January 31, 2014 2:56 AM
Points: 483, Visits: 256
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 02, 2013 8:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, April 07, 2014 7:35 AM
Points: 1,172, Visits: 2,413
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
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 4:30 PM
Points: 1,757, Visits: 2,577
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)
I'm not fat, I'm gravity challenged.
Post #1484001
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse