question

athma avatar image
athma asked

single step execution among multiple steps in a job

how can i execute a single step or the steps which i want from the multiple steps while the job is running. thank you
administration
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
I'm not sure I understand what you want to achieve. If you want start at a certain job-step within a job you can do: exec dbo.sp_start_job @job_name='multstep', @step_name='Step 2' But if you want to build some sort of control-flow within the job, to have conditions like: "If happens in job step 1, execute job step 2, otherwise execute job step 4" I' recommend building either a stored procedure or an SSIS-package with the control-flow you want to implement. That SP or SSIS-package can be run from a job. Please try to be a little bit more specific when you write your questions. EDIT When defining the job steps, you can put _some_ logic to it. When a job-step finishes, you can setup actions for what to do if the job is successful or unsuccessful. That way you have a built in control flow for each step. So you can for example setup Step 1 to go to Step 3 on Success and Step 2 on failure. END EDIT
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.