Sets a user-defined counter to a specified value.
sa_user_defined_counter_set( counter_name , value [, apply_to_con [, appy_to_db [, apply_to_server ] ] ]
Use this VARCHAR(128) parameter to specify the name of the user-defined counter whose value you want to change. Examples of user-defined counter names are UserDefinedCounterRate01 and UserDefinedCounterRaw01.
Use this BIGINT parameter to specify the value to which the user-defined counter is set.
Use this INT parameter to specify whether to adjust the counter value for the current connection. 0 means do not adjust the value, and 1 means adjust the value. The default is 1.
Use this INT parameter to specify whether to adjust the counter value for the database. 0 means do not adjust the value, and 1 means adjust the value. The default is 0.
Use this INT parameter to specify whether to adjust the counter value for the database server. 0 means do not adjust the value, and 1 means adjust the value. The default is 0.
This function returns an INTEGER status code.
This function returns 1 if value is defined, 0 if value is not defined, and an error code if an error occurs. Examples of errors include:
Concurrent access to counters is applied atomically, so a counter value can be reset from multiple, concurrent requests.
User-defined counters are implemented as 32-bit UNSIGNED INTEGER values.
You must have EXECUTE privilege on the system procedure, as well as the SERVER OPERATOR system privilege.
None
The following statement sets the value of UserDefinedCounterRate01 to 0 for the current connection, database, and database server:
SELECT sa_user_defined_counter_set( 'UserDefinedCounterRate01', 0, 1, 1, 1 );