Job.CurrentRunStatus Job.CurrentRunStatus Job.CurrentRunStatus Property

정의

작업의 현재 실행 상태를 가져옵니다. Gets the current execution status of the job.

public:
 property Microsoft::SqlServer::Management::Smo::Agent::JobExecutionStatus CurrentRunStatus { Microsoft::SqlServer::Management::Smo::Agent::JobExecutionStatus get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcProperty(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Expensive | Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcPropertyFlags.Standalone)]
public Microsoft.SqlServer.Management.Smo.Agent.JobExecutionStatus CurrentRunStatus { get; }
Public ReadOnly Property CurrentRunStatus As JobExecutionStatus
속성 값

JobExecutionStatus 작업의 현재 실행 상태를 지정 하는 값 개체입니다. A JobExecutionStatus object value that specifies the current execution status of the job.

예제

다음 코드 예제에서는 새 작업을 만들고 해당 상태를 표시 합니다.The following code example creates a new job and displays its status.

C#C#

Server srv = new Server("(local)");  
Job jb = new Job(srv.JobServer, "Test Job");  
jb.Create();  
Console.WriteLine(jb.CurrentRunStatus);  

PowerShellPowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$jb = new-object Microsoft.SqlServer.Management.Smo.Agent.Job($srv.JobServer, "Test Job")  
$jb.Create()  
Write-Host $jb.CurrentRunStatus  

적용 대상