JobSchedule Class

The JobSchedule class represents a SQL Server Agent job schedule.

Пространство имен: Microsoft.SqlServer.Management.Smo.Agent
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Синтаксис

'Декларация
Public NotInheritable Class JobSchedule
    Inherits ScheduleBase
    Implements IAlterable, ICreatable, IDroppable, IRenamable, _
    IScriptable
public sealed class JobSchedule : ScheduleBase, IAlterable, ICreatable, IDroppable, 
    IRenamable, IScriptable
public ref class JobSchedule sealed : public ScheduleBase, IAlterable, ICreatable, IDroppable, 
    IRenamable, IScriptable
public final class JobSchedule extends ScheduleBase implements IAlterable, ICreatable, 
    IDroppable, IRenamable, IScriptable
public final class JobSchedule extends ScheduleBase implements IAlterable, ICreatable, 
    IDroppable, IRenamable, IScriptable

Замечания

SQL Server Agent jobs can be scheduled for execution by using SQL Server Agent. Scheduling jobs automates job execution when SQL Server Agent is enabled but jobs are not required to be scheduled. They can be executed on demand by a sufficiently privileged user. Jobs can have more than one active schedule and SQL Server Agent evaluates all schedules to determine when to run the job. With the JobSchedule object, you can:

  • Create a schedule for a SQL Server Agent job.

  • Remove a schedule from an existing SQL Server Agent job.

  • Manage job schedules either by enabling a schedule or adjusting run times or frequencies.

Это пространство имен, класс или элемент поддерживаются только платформой Microsoft .NET Framework версии 2.0.

To get or set JobSchedule object properties, users must be a member of the SQLAgentUserRole database role on the MSDB database, or be the owner of the job, or be a member of the sysadmin fixed server role.

To create a job schedule, users must be a member of the SQLAgentUserRole database role on the MSDB database, or be a member of the sysadmin fixed server role.

To drop a job schedule, users must be a member of the SQLAgentUserRole database role on the MSDB database, or be a member of the sysadmin fixed server role.

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Management.Smo.SmoObjectBase
     Microsoft.SqlServer.Management.Smo.SqlSmoObject
       Microsoft.SqlServer.Management.Smo.NamedSmoObject
         Microsoft.SqlServer.Management.Smo.Agent.AgentObjectBase
           Microsoft.SqlServer.Management.Smo.Agent.ScheduleBase
            Microsoft.SqlServer.Management.Smo.Agent.JobSchedule

Пример

How to: Create a Job with Steps and a Schedule in Visual Basic .NET

Синхронизация потоков

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

JobSchedule Members
Microsoft.SqlServer.Management.Smo.Agent Namespace

Другие ресурсы

Scheduling Automatic Administrative Tasks in SQL Server Agent
Автоматизация задач администрирования (агент SQL Server)
sp_add_schedule (Transact-SQL)