다음을 통해 공유


Job.HasSchedule 속성

Gets the Boolean property value that specifies whether the job has at least one schedule.

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

구문

‘선언
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Expensive Or SfcPropertyFlags.Standalone)> _
Public ReadOnly Property HasSchedule As Boolean 
    Get
‘사용 방법
Dim instance As Job 
Dim value As Boolean 

value = instance.HasSchedule
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone)]
public bool HasSchedule { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Expensive|SfcPropertyFlags::Standalone)]
public:
property bool HasSchedule {
    bool get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone)>]
member HasSchedule : bool
function get HasSchedule () : boolean

속성 값

유형: System.Boolean
A Boolean value that specifies whether the job has a schedule assigned or not.If True, the job has at least one schedule. If False (default), the job has no schedule.

주의

You can query the JobSchedules collection property to evaluate which schedule is enabled for the job. If the HasSchedule property is False, the JobSchedules collection property is empty.

The following code example specifies that the job has at least one schedule.

C#

Server srv = new Server("(local)");
Job jb = new Job(srv.JobServer, "Test Job");
jb.HasSchedule = true;

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = new-object Microsoft.SqlServer.Management.Smo.Agent.Job($srv.JobServer, "Test Job")
$jb.HasSchedule = $TRUE

참고 항목

참조

Job 클래스

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

관련 자료

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

sp_add_job(Transact-SQL)

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