Job.JobSteps Job.JobSteps Job.JobSteps Property

정의

작업에 대해 정의된 작업 단계를 나타내는 JobStep 개체의 컬렉션을 가져옵니다. Gets a collection of JobStep objects that represent the job steps defined for the job.

public:
 property Microsoft::SqlServer::Management::Smo::Agent::JobStepCollection ^ JobSteps { Microsoft::SqlServer::Management::Smo::Agent::JobStepCollection ^ get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObject(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerRelationship.ChildContainer, Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerCardinality.ZeroToAny, typeof(Microsoft.SqlServer.Management.Smo.Agent.JobStep))]
public Microsoft.SqlServer.Management.Smo.Agent.JobStepCollection JobSteps { get; }
Public ReadOnly Property JobSteps As JobStepCollection
속성 값

JobStepCollection 개체 컬렉션을 지정하는 JobStep 개체 값입니다. A JobStepCollection object value that specifies a collection of JobStep objects.

예제

다음 코드 예제에는 작업과 연결 된 작업 단계를 만듭니다.The following code example creates a job and an associated job step.

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();  
Console.WriteLine(jb.JobSteps.ToString());  

PowerShellPowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$jb = new-object Microsoft.SqlServer.Management.Smo.Agent.Job($srv.JobServer, "Test Job23", 3)  
$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()  
Write-Host $jb.JobSteps  

적용 대상