August 1, 2013 at 12:21 am
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
August 1, 2013 at 12:48 am
Do you need two jobs? You can put JOB A as the first step and JOB B as the second step in one job?
August 1, 2013 at 1:17 am
How to create two jobs into one?
August 1, 2013 at 2:49 am
Open the properties of the first job.
Select the Steps page.
Click New to add a step containing the second job.
August 2, 2013 at 8:19 am
sandosh.star (8/1/2013)
how to trigger a job after completion of another job in sql server management studio 2005I 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
August 13, 2013 at 3:18 pm
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) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply