次の方法で共有


Subscription.ScheduleStart Property

スケジュールの開始情報を返します。値の設定も可能です。

名前空間: Microsoft.SqlServer.NotificationServices
アセンブリ: Microsoft.SqlServer.NotificationServices (microsoft.sqlserver.notificationservices.dll 内)

構文

'宣言
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)

プロパティ値

スケジュールの開始情報を表す String です。

解説

ScheduleRecurrence プロパティも NULL の場合は ScheduleStart プロパティに NULL を指定できますが、そうでない場合は ScheduleStart プロパティに値を指定する必要があります。サブスクリプションにスケジュールを割り当てるには、このプロパティの両方に値を設定します。

定期的なルールが設定されていない (HasTimedRule プロパティが false の) サブスクリプションの場合、ScheduleStart プロパティと ScheduleRecurrence プロパティには値を設定できません。

ScheduleStart の値は、次の表記のいずれかを使用して設定します。

  • TZID=TimeZoneId: yyyymmdd T hhnnss

  • yyyymmdd Thhnnss Z

それぞれについて以下で説明します。

  • TimeZoneId はタイム ゾーン ID です。

  • T は、大文字の "T" です。これは日付と時刻の区切り文字なので、日付と時刻の間に挿入します。

  • Z は、大文字の "Z" です。これは、"世界協定時刻 (UTC)" を表します。"TZID=UTC Time:" を指定するのと同じことを意味します。

  • yyyy は、西暦を表す 4 桁の数字です。

    [2000 | 2001 | 2002 | 2003 | ...]

  • mm は、月を表す 2 桁の数字です。

    [01 | 02 | 03 | ... | 11 | 12]

  • dd は、日付を表す 2 桁の数字です。

    [01 | 02 | 03 | ... | 30 | 31]

  • hh は、時間を表す 2 桁の数字です。時間は 24 時間制で示され、これは時、分、秒の時の部分を表します。

    [00 | 01 | 02 | 03 | ... | 12 | 13 | ... | 22 | 23]

  • nn は、分を表す 2 桁の数字です。

    [00 | 01 | 02 | 03 | ... | 58 | 59]

  • ss は、秒を表す 2 桁の数字です。

    [00 | 01 | 02 | 03 | ... | 58 | 59]

TimeZoneEnumeration オブジェクトによって返された Notification Services タイム ゾーン ID を指定すると、選択したタイム ゾーンのサブスクリプションが有効になります。タイム ゾーンを指定しない場合は、世界協定時刻 (UTC) を使用していることを示す定数 Z を使う必要があります。

時刻とタイム ゾーンは、通知が生成されるローカル時刻を指定します。Notification Services は、このタイム ゾーンを使用して、ローカル時刻をグリニッジ標準時 (GMT) に変換します。Notification Services は、夏時間への切り替えを認識し、それに応じて配信時間を調整します。

ScheduleStart の値の例 : 20010501T093000Z

使用例

ScheduleStart プロパティを使用してサブスクリプションのスケジュール開始情報を設定する例を次に示します。

' 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();

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

Subscription Class
Subscription Members
Microsoft.SqlServer.NotificationServices Namespace