次の方法で共有


Alert.PerformanceCondition プロパティ

パフォーマンス条件テキストを取得します。値の設定も可能です。

名前空間:  Microsoft.SqlServer.Management.Smo.Agent
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
<SfcPropertyAttribute(SfcPropertyFlags.Standalone)> _
Public Property PerformanceCondition As String 
    Get 
    Set
'使用
Dim instance As Alert 
Dim value As String 

value = instance.PerformanceCondition

instance.PerformanceCondition = value
[SfcPropertyAttribute(SfcPropertyFlags.Standalone)]
public string PerformanceCondition { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::Standalone)]
public:
property String^ PerformanceCondition {
    String^ get ();
    void set (String^ value);
}
[<SfcPropertyAttribute(SfcPropertyFlags.Standalone)>]
member PerformanceCondition : string with get, set
function get PerformanceCondition () : String 
function set PerformanceCondition (value : String)

プロパティ値

型: System.String
パフォーマンス条件を示す String 値です。

説明

PerformanceCondition プロパティを設定する場合、値では次の構文が必要です。

ObjectName|CounterName|Instance|ComparisonOp|CompValue

要素

説明

ObjectName

監視対象の Microsoft SQL Server オブジェクトの名前です。

CounterName

オブジェクトによって公開されているカウンターの名前です。

Instance

カウンターのインスタンスの名前です。

ComparisonOp

関係演算子 =、>、< のいずれか 1 つです。

CompValue

比較された数値です。

使用例

たとえば、エクステント ロックの平均待機時間が 1 秒 (1,000 ミリ秒) を超えた場合に発生する警告を作成するには、次の文字列を使用して PerformanceCondition プロパティを設定します。

SQLServer:Locks|Average Wait Time (ms)|Extent|>|1000

多くの SQL Server パフォーマンス モニターのカウンターは、インスタンス パラメーターを定義しません。 インスタンス パラメーターが適用されない場合は、value 文字列で空の Instance 要素を使用して、インスタンスが何も選択されないことを示します。

SQLServer:Access Methods|Page Splits/sec||>|50

SQL Server エージェントでの自動管理タスクのスケジュール設定

関連項目

参照

Alert クラス

Microsoft.SqlServer.Management.Smo.Agent 名前空間

その他の技術情報

管理タスクの自動化 (SQL Server エージェント)

sp_add_alert (Transact-SQL)