共用方式為


PerformanceCondition Property

未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。

The PerformanceCondition property specifies a Microsoft Windows Performance Monitor counter, a comparison operator and value, and enables raising a Microsoft® SQL Server™ 2000 Agent alert based on system activity.

語法

object
.PerformanceCondition [=value]

Parts

  • object
    Expression that evaluates to an object in the Applies To list
  • value
    String that specifies a Windows Performance Monitor object, counter, and instance as described in Remarks

Data Type

String

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetPerformanceCondition(SQLDMO_LPBSTR pRetVal)
HRESULT SetPerformanceCondition(SQLDMO_LPCSTR NewValue)
ms141246.note(zh-tw,SQL.90).gif附註:
SQL-DMO strings are always returned as OLE BSTR objects. A C/C++ application obtains a reference to the string. The application must release the reference using SysFreeString.

備註

When setting the PerformanceCondition property, value uses the syntax:

        ObjectName
      

|

        CounterName
      

|

        Instance
      

|

        ComparisonOp
      

|

        CompValue
      
Part Description

ObjectName

Name of a monitored Microsoft SQL Server object

CounterName

Name of a counter exposed by the object

Instance

Name of an instance of the counter

ComparisonOp

One of the relational operators =, >, or <

CompValue

Numeric value compared

For example, to create an alert raised when the average wait time for an extent lock rises above 1 second (1,000 milliseconds), set the PerformanceCondition property using the string:

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

Many SQL Server Performance Monitor counters do not define instance parameters. When an instance parameter is not applicable, indicate that no instance is selected using an empty Instance part in the value string, as in:

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

For more information about SQL Server objects exposing Performance Monitor counters, see Using SQL Server Objects.

Applies To:

Alert Object