次の方法で共有


FunctionValue Class

Transact-SQL ユーザー定義関数から値を取得する Argument オブジェクトを表します。

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

構文

'宣言
Public Class FunctionValue
    Inherits Argument
public class FunctionValue : Argument
public ref class FunctionValue : public Argument
public class FunctionValue extends Argument
public class FunctionValue extends Argument

解説

カスタム データベース ロジックを使用して引数値を決定するために、FunctionValue クラスを使用します。ユーザー定義関数には、スカラ戻り値の型が必要です。

FunctionValue コンストラクタで、または ParametersName プロパティを使用して、ユーザー定義関数およびパラメータを指定する必要があります。

継承階層

System.Object
   Microsoft.SqlServer.NotificationServices.Rules.RuleObject
     Microsoft.SqlServer.NotificationServices.Rules.Argument
      Microsoft.SqlServer.NotificationServices.Rules.FunctionValue

使用例

次の例では、ユーザー定義関数の定義を示し、その関数を使用してイベントを評価します。

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

スレッド セーフ

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

プラットフォーム

開発プラットフォーム

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

対象プラットフォーム

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

参照

関連項目

FunctionValue Members
Microsoft.SqlServer.NotificationServices.Rules Namespace

その他の技術情報

ストアド プロシージャの使用 (MDX)