(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 ] )
ID of the instance.
name of the instance.
float value representing the new metric.
Sees the user metric on the current instance:
select workload_metric()
Sees the user metric on instance “ase2”:
select workload_metric("ase2")
Sets the value of the user metric on “ase3” to 27.54:
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.
You must have the sa_role or ha_role to execute workload_metric