Метод Job.RemoveAllJobSteps
Removes all the job steps associated with the job.
Пространство имен: Microsoft.SqlServer.Management.Smo.Agent
Сборка: Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)
Синтаксис
'Декларация
Public Sub RemoveAllJobSteps
'Применение
Dim instance As Job
instance.RemoveAllJobSteps()
public void RemoveAllJobSteps()
public:
void RemoveAllJobSteps()
member RemoveAllJobSteps : unit -> unit
public function RemoveAllJobSteps()
Замечания
Successful execution of the RemoveAllJobSteps method disables the referenced job, and empties the JobSteps collection property of the Job object. To re-enable the referenced job, create JobStep objects and add them to the JobSteps collection property of the Job object.
Примеры
The following code example disables the "Test Job" job and deletes all defined steps from it.
C#
Server srv = new Server("(local)");
Job jb = srv.JobServer.Jobs["Test Job"];
jb.RemoveAlljobSteps();
PowerShell
$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = $srv.JobServer.Jobs["Test Job"]
$jb.RemoveAllJobSteps()
См. также
Справочник
Пространство имен Microsoft.SqlServer.Management.Smo.Agent
Другие ресурсы
Планирование автоматических административных задач в агенте SQL Server
Задачи автоматизированного администрирования (агент SQL Server)