I am trying execute the SQL Server job using a batch command. I use this command to call a job.
osql -S “[SQL SERVER NAME]” -E -Q”exec msdb.dbo.sp_start_job ‘[SQL JOB NAME]‘”
But I want to skip the first 4 steps, instead I want to start the job from step 5.
You have to use step_name
parameter :
EXEC msdb.dbo.sp_start_job @job_name = 'your_job_name', @step_name='step_name'
Example: EXEC msdb.dbo.sp_start_job @job_name = 'myJob', @step_name='Insert into TGR0'
to start from step 2.