Job.EnumJobStepsByID Job.EnumJobStepsByID Job.EnumJobStepsByID Method

정의

배열을 반환 JobStep 개체 참조 된 작업에 속하고 하는 ID 값으로 정렬 됩니다. Returns an array of JobStep objects that belong to the referenced job and that are ordered by ID value.

public:
 cli::array <Microsoft::SqlServer::Management::Smo::Agent::JobStep ^> ^ EnumJobStepsByID();
public Microsoft.SqlServer.Management.Smo.Agent.JobStep[] EnumJobStepsByID ();
Public Function EnumJobStepsByID () As JobStep()
반환

참조된 작업에 속하는 모든 작업 단계를 나타내는 JobStep 개체 배열입니다. A JobStep object array that represents all the job steps that belong to the referenced job. JobStep 개체는 ID 값으로 정렬 됩니다. The JobStep objects are ordered by ID value.

예제

다음 코드 예제에서는 작업을 만든 다음 ID로 정렬 하는 작업 단계가 표시 됩니다.The following code example creates a job then displays the job steps ordered by ID.

C#C#

Server srv = new Server("(local)");  
Job jb = new Job(srv.JobServer, "Test Job");  
jb.Create();  
JobStep jbstp = new JobStep(jb, "Test Job Step");  
jbstp.OnSuccessAction = StepCompletionAction.QuitWithSuccess;  
jbstp.OnFailAction = StepCompletionAction.QuitWithFailure;  
jbstp.Create();  
JobStep[] jobStepsbyID = jb.EnumJobStepsByID();  

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()  
$jbstp = new-object Microsoft.SqlServer.Management.Smo.Agent.JobStep($jb, "Test Job Step")  
$jbstp.OnSuccessAction = [Microsoft.SqlServer.Management.Smo.Agent.StepCompletionAction]::QuitWithSuccess  
$jbstp.OnFailAction = [Microsoft.SqlServer.Management.Smo.Agent.StepCompletionAction]::QuitWithFailure  
$jbstp.Create()  
$jobStepsbyID = $jb.EnumJobStepsByID()  

적용 대상