(Riga) Can I run a separate job step? Not the whole job?

  • I have job on SQL Server 2000.

    Can I run a separate job step? Not the whole job?

  • If you access the job through EM and the agent you shouild be able to open the job, then right click and exeute the step in question.

    Gethyn Elliswww.gethynellis.com

  • If you right-click the job in EM

    you have:

    New Job

    Start Job

    Stop Job

    Enable Job

    View Job History...

    Refresh Job

    All Tasks >Generate SQl script

    Delete

    Properties

    Help

    Where should I go to execute a specific Job 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. You can't run just one step without disabling that flow first. For example, if the job has 3 steps and you only want to run the first one, you'd have to disable the on success/failure flow for that step so it wouldn't run steps 2 and 3.

    Greg

  • Thanks. I figured it out.

    Is there a T-SQL code to do the same thing?

  • sp_start_job

  • [font="Verdana"]Yes thats right, You can use Sp_start_job on MSDB database!

    eg.)

    sp_start_job @job_name='your jobname'[/font]

  • Specifically, it would be

    sp_start_job @job_name='your jobname', @step_name = 'your stepname'

    Greg

  • Thank You.... Greg Charles... 🙂

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply