'Run specific step in sql job without running the entire job
I have a Job name ' TEST' which is having 3 steps.
There is a requirement to run only the Step 2, But when I right click on job name and click on start job at step and start the job from step 2 it runs the step 3 as well.
Even when I run the job like
EXEC msdb..sp_start_job @job_name = 'Test', @step_name='2'
It still run the step 3 which I don't want.
Is there a way in this scenario. I dont want to add step-2 in a seperate job and run it seperately.
Solution 1:[1]
Starting a job at a specific step bypasses the previous ones, not the subsequent. Also, to my knowledge, you may not bypass the next ones in any way, or disable a step.
For a temporary solution, I'd recommend moving your desired step (2) to the end, and then execute starting at it.
Solution 2:[2]
You can't bypass the next step. You will need to either move down the step or create a separate SQL job to run the given step.
Solution 3:[3]
Another possibility is to edit the step's "on success action".
First, open the Job Properties, select the relevant step, and select "Edit":

Next, go to the "Advanced" tab and change "On success action" from "Go to the next step" to "Quit the job reporting success".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | George Menoutis |
| Solution 2 | Thilina Nakkawita |
| Solution 3 | EJoshuaS - Stand with Ukraine |

