Share via


Job.EnumHistory 메서드

Enumerates a list of execution history associated with the referenced job.

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

구문

‘선언
Public Function EnumHistory As DataTable
‘사용 방법
Dim instance As Job 
Dim returnValue As DataTable 

returnValue = instance.EnumHistory()
public DataTable EnumHistory()
public:
DataTable^ EnumHistory()
member EnumHistory : unit -> DataTable
public function EnumHistory() : DataTable

반환 값

유형: System.Data.DataTable
A DataTable object value that contains execution history data for the referenced job.

The following code example creates a job then displays its execution history.

C#

Server srv = new Server("(local)");
Job jb = srv.JobServer.Jobs["Test Job"];
DataTable jobHistory = jb.EnumHistory();

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = $srv.JobServer.Jobs["Test Job"]
$jobHistory = $jb.EnumHistory()

참고 항목

참조

Job 클래스

EnumHistory 오버로드

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

관련 자료

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

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

sp_help_job(Transact-SQL)