Job.Start 메서드

Runs the referenced job.

네임스페이스:  Microsoft.SqlServer.Management.Smo.Agent
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Sub Start
‘사용 방법
Dim instance As Job

instance.Start()
public void Start()
public:
void Start()
member Start : unit -> unit
public function Start()

The following code example creates a job and starts it.

C#

Server srv = new Server("(local)");
Job jb = new Job(srv.JobServer, "Test Job");
jb.Create();
JobStep jbstp = new JobStep(jb, "Test Job Step");
jbstp.OnSuccessAction = StepCompletionAction.QuitWithSuccess;
jbstp.OnFailAction = StepCompletionAction.QuitWithFailure;
jbstp.Create();
jb.ApplyToTargetServer(srv.Name);
jb.IsEnabled = true;
jb.Start();

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = new-object Microsoft.SqlServer.Management.Smo.Agent.Job($srv.JobServer, "Testrrt Job")
$jb.Create()
$jbstp = new-object Microsoft.SqlServer.Management.Smo.Agent.JobStep($jb, "Test Job Step")
$jbstp.OnSuccessAction = [Microsoft.SqlServer.Management.Smo.Agent.StepCompletionAction]::QuitWithSuccess
$jbstp.OnFailAction = [Microsoft.SqlServer.Management.Smo.Agent.StepCompletionAction]::QuitWithFailure
$jbstp.Create()
$jb.ApplyToTargetServer($srv.Name)
$jb.IsEnabled = $TRUE
$jb.Start()

참고 항목

참조

Job 클래스

Start 오버로드

Microsoft.SqlServer.Management.Smo.Agent 네임스페이스

관련 자료

SQL Server 에이전트에서 자동 관리 태스크 예약

관리 태스크 자동화(SQL Server 에이전트)

sp_add_job(Transact-SQL)