Job.LastRunOutcome Job.LastRunOutcome Job.LastRunOutcome Property

정의

마지막으로 작업 실행을 완료한 시점의 작업 결과를 가져옵니다. Gets the result of the job from the last time it completed execution.

public:
 property Microsoft::SqlServer::Management::Smo::Agent::CompletionResult LastRunOutcome { Microsoft::SqlServer::Management::Smo::Agent::CompletionResult 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.CompletionResult LastRunOutcome { get; }
Public ReadOnly Property LastRunOutcome As CompletionResult
속성 값

마지막 작업 실행 완료의 결과를 지정하는 CompletionResult 개체 값입니다. A CompletionResult object value that specifies the result of the last time the job completed executing.

예제

다음 코드 예제에서는 작업을 만들고 있는 마지막으로 실행 한 날짜를 표시 합니다.The following code example creates a job and displays the date upon which it was last run.

C#C#

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

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.LastRunOutcome  

적용 대상