Subscription.ScheduleStart Property
Gets or sets the schedule start information.
Namespace: Microsoft.SqlServer.NotificationServices
Assembly: Microsoft.SqlServer.NotificationServices (in microsoft.sqlserver.notificationservices.dll)
Syntax
'Declaration
Public Property ScheduleStart As String
public string ScheduleStart { get; set; }
public:
virtual property String^ ScheduleStart {
String^ get () sealed;
void set (String^ value) sealed;
}
/** @property */
public final String get_ScheduleStart ()
/** @property */
public final void set_ScheduleStart (String value)
public final function get ScheduleStart () : String
public final function set ScheduleStart (value : String)
Property Value
A String containing schedule start information.
Remarks
The ScheduleStart property can be null if the ScheduleRecurrence property is also null; otherwise ScheduleStart must have a specified value. These properties are used together to assign a schedule to a subscription.
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.
You can specify the ScheduleStart value by using one of the following notations:
TZID=TimeZoneId: yyyymmdd T hhnnss
yyyymmdd T hhnnss Z
where the format indicates the following:
TimeZoneId is the time zone ID.
T is the uppercase character "T". It is the date-time separation character and it must appear between the date and time.
Z is the uppercase character "Z". It represents "UTC Time". It is equivalent to specifying "TZID=UTC Time:".
yyyy is the four-digit year.
[2000 | 2001 | 2002 | 2003 | ...]
mm is the two-digit month of the year.
[01 | 02 | 03 | ... | 11 | 12]
dd is the two-digit day of the month.
[01 | 02 | 03 | ... | 30 | 31]
hh is the two-digit hour in 24-hour time.
[00 | 01 | 02 | 03 | ... | 12 | 13 | ... | 22 | 23]
nn is the two-digit minute.
[00 | 01 | 02 | 03 | ... | 58 | 59]
ss is the two-digit second.
[00 | 01 | 02 | 03 | ... | 58 | 59]
Specifying the Notification Services time zone ID (returned by a TimeZoneEnumeration object) causes that subscription to be enabled for the selected time zone. Otherwise, you must use the constant Z to indicate that you are using Universal Time Coordinate (UTC) notation instead.
The time and time zone specify the local time of day at which the notification is generated. Notification Services uses the time zone to convert the local time of day to Greenwich Mean Time (GMT) time. Notification Services is aware of daylight savings time transitions and adjusts delivery times accordingly.
For example, a valid ScheduleStart value would be 20010501T093000Z.
Example
The following examples show how to use the ScheduleStart property to set subscription schedule start 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();
Thread Safety
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.
Platforms
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.
Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.
See Also
Reference
Subscription Class
Subscription Members
Microsoft.SqlServer.NotificationServices Namespace