Enables and disables the logging of a system-defined or user-defined message in the SAP ASE error log.
sp_altermessage message_id, parameter, parameter_value
sp_altermessage 2000, 'with_log', 'TRUE'
If the parameter_value is true, the specified message is always logged. If it is false, the default logging behavior is used; the message may or may not be logged, depending on the severity of the error and other factors. Setting the parameter_value to false produces the same behavior that would occur if sp_altermessage had not been called.
On Windows servers, sp_altermessage also enables and disables logging in the Windows Event Log.
The permission checks for sp_altermessage differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled, you must be the database owner or a user with own database privilege. |
Disabled | With granular permissions disabled, you must be the database owner or a user with sa_role. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|