Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Agent Jobs: How to execute a job step without executing the entire job

I have a SQL Server Agent Job that previously had two steps. Today, I've had to integrate the third step, and soon I'll need to integrate a fourth.

I want to be sure that the step will execute properly but I do not want to execute the entire job.

The first two steps take quite a bit of time to execute and during the day they hog a significant amount of the SQL resources that my users need.

Is there a way that I can execute a job step and not an entire job process?

Within SSMS, if I right-click on the job there is an option that states "Start Job at step..." except when I try that option it brings up a dialog that seems to imply that the entire job has been started. What can I do to test one step within a job?

Thanks in advance.

like image 444
RLH Avatar asked Jun 20 '11 14:06

RLH


People also ask

How do I start a SQL job at a specific step?

When you right-click on the job and select 'Start Job', you'll be able to choose the step you want to start, if it's a multi-step job. Note that the job will start at the step you specify and run any steps after that depending on the on success/failure flow for each step.

How do you skip a job step based on outcome of previous SQL Agent job step?

You actually cannot disable a step in SQL Server Agent Job, but you can skip it. To skip a step open up the previous step –> Go to Advance tab –> On Success action: select the appropriate step.

How do I execute a stored procedure in SQL Agent?

Expand the SQL Server Agent and right click on Jobs and click on New Job… In General tab, Enter job name, owner, category and description. In Steps tab, click New and enter step name, select Type as Transact-SQL script (T-SQL) and select database and put EXEC procedure name in command area.


1 Answers

"Start job at step" will start the job at the step you specify. However - if you don't wish to execute any subsequent steps - be sure to adjust the step logic so that it will "Quit reporting success" after completing the step you started at.

like image 140
Rich Avatar answered Sep 20 '22 16:09

Rich