Share via


Job.RemoveAllJobSchedules 메서드 (Boolean)

Removes all unused schedules from the job.

네임스페이스:  Microsoft.SqlServer.Management.Smo.Agent
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Sub RemoveAllJobSchedules ( _
    keepUnusedSchedules As Boolean _
)
‘사용 방법
Dim instance As Job 
Dim keepUnusedSchedules As Boolean

instance.RemoveAllJobSchedules(keepUnusedSchedules)
public void RemoveAllJobSchedules(
    bool keepUnusedSchedules
)
public:
void RemoveAllJobSchedules(
    bool keepUnusedSchedules
)
member RemoveAllJobSchedules : 
        keepUnusedSchedules:bool -> unit
public function RemoveAllJobSchedules(
    keepUnusedSchedules : boolean
)

매개 변수

  • keepUnusedSchedules
    유형: System.Boolean
    A Boolean value that specifies whether to keep the unused schedules from the removed job.If True, the shared schedules are kept.If False, the shared schedules are not kept.

주의

On successful execution, the JobSchedules collection property of the Job object is emptied. To reschedule the referenced job, create JobSchedule objects and add them to the JobSchedulescollection property of the Job object.

The following code example deletes all non-shared schedules from the "Test Job" job.

C#

Server srv = new Server("(local)");
Job jb = srv.JobServer.Jobs["Test Job"];
jb.RemoveAllJobSchedules(true);

PowerShell

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

참고 항목

참조

Job 클래스

RemoveAllJobSchedules 오버로드

Microsoft.SqlServer.Management.Smo.Agent 네임스페이스

관련 자료

SQL Server 에이전트에서 자동 관리 태스크 예약

관리 태스크 자동화(SQL Server 에이전트)

sp_delete_jobschedule(Transact-SQL)