techno
techno

Reputation: 192

What is the difference between Enable a job and Start a job in Sql Server Agent

Well, I'm new to this... I trying to understand the difference between Enabling a Sql Job and Starting a Job at a step? The both seem to work in the same manner... or is there a difference?

Upvotes: 1

Views: 1913

Answers (1)

AA.SC
AA.SC

Reputation: 377

Enabling a Sql Agent Job - means Job is active on server and will be executed on scheduled time Starting a Job step - means either server has started a job step on scheduled time or you have started it forcefully,
Lets say a job has 5 steps and you don't want to execute first 3, here SQL Server Agent provide you facility that you can start a job execution from step 4.

http://msdn.microsoft.com/en-us/library/ms189817.aspx

SELECT  [enabled] --enabled Indicates whether the job is enabled to be executed.
        ,name
FROM    msdb.dbo.sysjobs
WHERE   name = 'Your Job Name'

http://msdn.microsoft.com/en-us/library/ms187387.aspx

SELECT  step_id,
        step_name -- Name of the job step
FROM    msdb.dbo.SysJobSteps
WHERE   job_id = ( SELECT   job_id
                   FROM      msdb.dbo.sysjobs
                   WHERE    name =  'Your Job Name'
                 )

Upvotes: 2

Related Questions