다음을 통해 공유


FunctionValue Constructor (UserDefinedFunction, Argument[])

Initializes a new instance of the FunctionValue class with a user-defined function and the function parameters.

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

구문

‘선언
Public Sub New ( _
    userDefinedFunction As UserDefinedFunction, _
    ParamArray parameters As Argument() _
)
public FunctionValue (
    UserDefinedFunction userDefinedFunction,
    params Argument[] parameters
)
public:
FunctionValue (
    UserDefinedFunction^ userDefinedFunction, 
    ... array<Argument^>^ parameters
)
public FunctionValue (
    UserDefinedFunction userDefinedFunction, 
    Argument[] parameters
)
public function FunctionValue (
    userDefinedFunction : UserDefinedFunction, 
    ... parameters : Argument[]
)

매개 변수

  • parameters
    Zero or more Argument objects that define the parameters for the user-defined function.

주의

The user-defined function must have a scalar return type.

If you specify zero parameters, you must specify the function using the UserDefinedFunction property and you must specify the parameters for the function using the Parameters property.

The following example shows the definition of a user-defined function, and then uses this function to evaluate events:

// Subscription based on the following function definition:

/*
create function SoundexMatch(@x nvarchar(max), @y nvarchar(max))
returns bit
as
begin
    if soundex(@x) = soundex(@y)
        return 1

    return 0
end
 * */

// Create subscription and define basic properties.
s = new Subscription(nsApplication, subscriptionClassName);
s.SubscriberId = "Richard";
s.Enabled = true;
s.RuleName = "InventoryTrackerRule";
s.SetFieldValue("DeviceName", "myDevice");
s.SetFieldValue("SubscriberLocale", "en-us");

// Define a condition that uses the function to evaluate
// if the condition is true.
s.Condition = new BooleanLeafCondition(new FunctionValue(
    db.UserDefinedFunctions["SoundexMatch", "dbo"],
    new FieldValue("ProductName"),
    "Rood-250 Black, 48"));

// Add subscription.
s.Add();

플랫폼

개발 플랫폼

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

대상 플랫폼

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

참고 항목

참조

FunctionValue Class
FunctionValue Members
Microsoft.SqlServer.NotificationServices.Rules Namespace

관련 자료

사용자 정의 함수(데이터베이스 엔진)