(Cluster environments only) Queries the current workload metric for the instance you specify, or updates the metric for the instance you specify.
workload_metric( instance_id | instance_name [, new_value ] )
select workload_metric()
select workload_metric("ase2")
select workload_metric("ase3", 27.54)
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.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for workload_metric differ based on your granular permissions settings.
Granular Permissions | Description |
---|---|
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. |