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)