Share via


Job.EnumJobStepLogs 方法 (Int32)

Enumerates a list of job step log files for the job step with the specified ID value.

命名空间:  Microsoft.SqlServer.Management.Smo.Agent
程序集:  Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)

语法

声明
Public Function EnumJobStepLogs ( _
    stepId As Integer _
) As DataTable
用法
Dim instance As Job 
Dim stepId As Integer 
Dim returnValue As DataTable 

returnValue = instance.EnumJobStepLogs(stepId)
public DataTable EnumJobStepLogs(
    int stepId
)
public:
DataTable^ EnumJobStepLogs(
    int stepId
)
member EnumJobStepLogs : 
        stepId:int -> DataTable
public function EnumJobStepLogs(
    stepId : int
) : DataTable

参数

返回值

类型:System.Data.DataTable
A DataTable object value that contains an enumerated list of all the job step log files for the job step with the specified ID value.

示例

The following code example creates a job then displays the job step log files for the specified job step ID.

C#

Server srv = new Server("(local)");
Job jb = srv.JobServer.Jobs["Test Job"];
DataTable stepLogs = jb.EnumStepLogs(1);

PowerShell

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

请参阅

参考

Job 类

EnumJobStepLogs 重载

Microsoft.SqlServer.Management.Smo.Agent 命名空间

其他资源

在 SQL Server 代理中计划自动管理任务

自动执行管理任务(SQL Server 代理)

sp_help_jobsteplog (Transact-SQL)