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 ] )
instance_id – the id of the instance.
instance_name – the name of the instance.
new_value – is a float value representing the new metric.
Example 1 To see the user metric on the current instance:
select workload_metric()
Example 2 To see the user metric on instance “ase2”:
select workload_metric("ase2")
Example 3 To set 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.
The sa_role or ha_role is required to execute workload_metric.