다음을 통해 공유


SubscriptionScheduledRule Constructor (SubscriptionClass, String)

Initializes a new instance of the SubscriptionScheduledRule class with a SubscriptionClass and a name.

네임스페이스: Microsoft.SqlServer.Management.Nmo
어셈블리: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

구문

‘선언
Public Sub New ( _
    subscriptionClass As SubscriptionClass, _
    name As String _
)
public SubscriptionScheduledRule (
    SubscriptionClass subscriptionClass,
    string name
)
public:
SubscriptionScheduledRule (
    SubscriptionClass^ subscriptionClass, 
    String^ name
)
public SubscriptionScheduledRule (
    SubscriptionClass subscriptionClass, 
    String name
)
public function SubscriptionScheduledRule (
    subscriptionClass : SubscriptionClass, 
    name : String
)

매개 변수

  • name
    A String, between 1 and 255 characters in length, that specifies the name of the scheduled rule.

    You cannot change the name. To rename a rule, you must remove the rule and the add the rule with the new name.

주의

Each scheduled rule must have a name, and it must be unique within the application.

This constructor sets a default ActionTimeout value of 30 minutes.

The following examples show how to define a scheduled rule and add it to a subscription class:

// Add a rule to generate basic scheduled notifications
SubscriptionScheduledRule flightScheduledRule = 
    new SubscriptionScheduledRule(
    flightSubscriptions, "FlightScheduledRule");
flightScheduledRule.Action = "INSERT INTO FlightNotifications " + 
    "(SubscriberId, DeviceName, SubscriberLocale, " +
    " LeavingFrom, GoingTo, Price) " + 
    " SELECT S.SubscriberId, S.DeviceName, S.SubscriberLocale, " +
    " EC.LeavingFrom, EC.GoingTo, EC.Price " + 
    " FROM FlightEventChronicle EC, FlightSubscriptions S " +
    " WHERE EC.LeavingFrom = S.LeavingFrom " + 
    " AND EC.GoingTo = S.GoingTo " +
    " AND EC.Price < S.Price";
flightScheduledRule.ActionTimeout = new TimeSpan(0, 0, 30);
flightSubscriptions.SubscriptionScheduledRules.Add(
    flightScheduledRule);
' Add a rule to generate basic scheduled notifications
Dim flightScheduledRule As SubscriptionScheduledRule = _
    New SubscriptionScheduledRule(flightSubscriptions, _
        "FlightScheduledRule")
flightScheduledRule.Action = _
    "INSERT INTO FlightNotifications " + _
    "(SubscriberId, DeviceName, SubscriberLocale, " + _
    "LeavingFrom, GoingTo, Price) " + _
    "SELECT S.SubscriberId, S.DeviceName, S.SubscriberLocale,  " + _
    "EC.LeavingFrom, EC.GoingTo, EC.Price " + _
    "FROM FlightEventChronicle EC, FlightSubscriptions S " + _
    "WHERE EC.LeavingFrom = S.LeavingFrom " + _
    "AND EC.GoingTo = S.GoingTo " + _
    "AND EC.Price < S.Price"
flightScheduledRule.ActionTimeout = New TimeSpan(0, 0, 30)
flightSubscriptions.SubscriptionScheduledRules.Add( _
    flightScheduledRule)

플랫폼

개발 플랫폼

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

대상 플랫폼

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

참고 항목

참조

SubscriptionScheduledRule Class
SubscriptionScheduledRule Members
Microsoft.SqlServer.Management.Nmo Namespace

관련 자료

예약 규칙 정의
ScheduledRule Element (ADF)
RuleName Element for ScheduledRule (ADF)