다음을 통해 공유


Subscription.ScheduleRecurrence Property

Gets or sets the schedule recurrence information.

네임스페이스: Microsoft.SqlServer.NotificationServices
어셈블리: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)

구문

‘선언
Public Property ScheduleRecurrence As String
public string ScheduleRecurrence { get; set; }
public:
virtual property String^ ScheduleRecurrence {
    String^ get () sealed;
    void set (String^ value) sealed;
}
/** @property */
public final String get_ScheduleRecurrence ()

/** @property */
public final void set_ScheduleRecurrence (String value)
public final function get ScheduleRecurrence () : String

public final function set ScheduleRecurrence (value : String)

속성 값

A String containing schedule recurrence information.

주의

The ScheduleRecurrence property can be null if the ScheduleStart property is also null; otherwise ScheduleRecurrence must have a specified value. These properties are used together to assign a schedule to a subscription.

The value of the ScheduleRecurrence property must be in ICalendar format and use ICalendar recurrence rule syntax. All alphabetic characters in the ScheduleRecurrence property value must be in upper case.

A subscription with no timed rules (where the HasTimedRule property is false) does not permit values to be specified for the ScheduleStart and ScheduleRecurrence properties.

The ICalendar recurrence options are shown in the following table.

ICalendar Recurrence Options

FREQ=DAILY;

FREQ=WEEKLY;BYDAY=DaysOfWeekList;[BYMONTH=MonthsOfYearList;]

FREQ=MONTHLY;BYMONTHDAY=DaysOfMonthList;[BYMONTH=MonthsOfYearList;]

FREQ=YEARLY;BYMONTHDAY=DayOfMonth;BYMONTH=MonthOfYear;

The options that can be used to specify the schedule are:

  • DaysOfWeekList is [DayOfWeek | DayOfWeek,DaysOfWeekList]

    DayOfWeek is [MO | TU | WE | TH | FR | SA | SU]

  • DaysOfMonthList is [DayOfMonth | DayOfMonth,DaysOfMonthList]

    DayOfMonth is [1 | 2 | 3 | ... | 30 | 31]

  • MonthsOfYearList is [MonthOfYear | MonthOfYear,MonthsOfYearList]

    MonthOfYear is [1 | 2 | 3 | ... | 11 | 12]

For example, a valid ScheduleRecurrence value for recurrences on the first and last three months, for the first, eleventh, and fifteenth days of those months, would be FREQ=MONTHLY;BYMONTHDAY=1,11,15;BYMONTH=1,2,3,10,11,12.

The following examples show how to use the ScheduleRecurrence property to set subscription schedule recurrence information:

' Set the recurrence of the subscription.
testSubscription.ScheduleRecurrence = "FREQ=DAILY"
 
' Set the start date and time of the subscription.
Dim scheduleBuilder As New StringBuilder()
scheduleBuilder.AppendFormat( _
    "TZID={0}:{1}{2}{3}T{4}{5}{6}", "4", _
    DateTime.Now.Year.ToString("D4"), _
    DateTime.Now.Month.ToString("D2"), _
    DateTime.Now.Day.ToString("D2"), _
    DateTime.Now.Hour.ToString("D2"), _
    DateTime.Now.Minute.ToString("D2"), _
    DateTime.Now.Second.ToString("D2"))
testSubscription.ScheduleStart = scheduleBuilder.ToString()
// Set the recurrence of the subscription.
testSubscription.ScheduleRecurrence = "FREQ=DAILY";

// Set the start date and time of the subscription.
StringBuilder scheduleBuilder = new StringBuilder();
scheduleBuilder.AppendFormat("TZID={0}:{1}{2}{3}T{4}{5}{6}",
    "4",
    DateTime.Now.Year.ToString("D4"),
    DateTime.Now.Month.ToString("D2"),
    DateTime.Now.Day.ToString("D2"),
    DateTime.Now.Hour.ToString("D2"),
    DateTime.Now.Minute.ToString("D2"),
    DateTime.Now.Second.ToString("D2"));
testSubscription.ScheduleStart = scheduleBuilder.ToString();

스레드 보안

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.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

Subscription Class
Subscription Members
Microsoft.SqlServer.NotificationServices Namespace