workload_metric

(Cluster environments only) Queries the current workload metric for the instance you specify, or updates the metric for the instance you specify.

Syntax

workload_metric( instance_id | instance_name [, new_value ] )

Parameters

Examples

Usage

  • A NULL value indicates the current instance.

  • If a value is specified for new_value, the specified value becomes the current user metric. If a value is not specified for new_value, the current workload metric is returned.

  • The value of new_value must be zero or greater.

  • If a value is supplied for new_value, workload_metric returns that value if the operation is successful. Otherwise, workload_metric returns -1.

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for workload_metric differ based on your granular permissions settings.

Granular PermissionsDescription
Enabled

With granular permissions enabled, you must have manage cluster permission or be a user with ha_role to execute workload_metric.

Disabled

With granular permissions disabled, you must be a user with sa_role or ha_role to execute workload_metric.