Метод Job.EnumJobStepsByID
Returns an array of JobStep objects that belong to the referenced job and that are ordered by ID value.
Пространство имен: Microsoft.SqlServer.Management.Smo.Agent
Сборка: Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)
Синтаксис
'Декларация
Public Function EnumJobStepsByID As JobStep()
'Применение
Dim instance As Job
Dim returnValue As JobStep()
returnValue = instance.EnumJobStepsByID()
public JobStep[] EnumJobStepsByID()
public:
array<JobStep^>^ EnumJobStepsByID()
member EnumJobStepsByID : unit -> JobStep[]
public function EnumJobStepsByID() : JobStep[]
Возвращаемое значение
Тип: array<Microsoft.SqlServer.Management.Smo.Agent.JobStep[]
A JobStep object array that represents all the job steps that belong to the referenced job. The JobStep objects are ordered by ID value.
Примеры
The following code example creates a job then displays the job steps ordered by ID.
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();
PowerShell
$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()
См. также
Справочник
Пространство имен Microsoft.SqlServer.Management.Smo.Agent
Другие ресурсы
Планирование автоматических административных задач в агенте SQL Server
Задачи автоматизированного администрирования (агент SQL Server)