Freigeben über


Job.EnumHistory-Methode

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

Namespace:  Microsoft.SqlServer.Management.Smo.Agent
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
Public Function EnumHistory As DataTable
'Usage
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

Rückgabewert

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

Beispiele

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()

Siehe auch

Verweis

Job Klasse

EnumHistory-Überladung

Microsoft.SqlServer.Management.Smo.Agent-Namespace

Andere Ressourcen

Planen von automatischen, administrativen Tasks im SQL Server-Agent

Automatisierte Administrationstasks (SQL Server-Agent)

sp_help_job (Transact-SQL)