Allows users to enter user-defined audit records (comments) into the audit trail.
sp_addauditrecord [text [, db_name [, obj_name [, owner_name [, dbid [, objid]]]]]]
sp_addauditrecord "I gave A. Smith permission to view the payroll table in the corporate database. This permission was in effect from 3:10 to 3:30 pm on 9/22/92.", "corporate", "payroll", "dbo", 10, 1004738270
sp_addauditrecord @text="I am disabling auditing briefly while we reconfigure the system", @db_name="corporate"
The SAP ASE server writes all audit records to the current audit table. The current audit table is determined by the value of the current audit table configuration parameter, set with sp_configure. An installation can have up to eight system audit tables, named sysaudits_01, sysaudits_02, and so forth, through sysaudits_08.
You have been granted execute permission on sp_addauditrecord – no special role is required
Auditing is enabled – a system security officer used sp_configure to turn on the auditing configuration parameter
The adhoc option of sp_audit is set to on
The permission checks for sp_addauditrecord differ based on your granular permissions settings.
Setting | Description |
---|---|
Enabled | With granular permissions enabled:
|
Disabled | With granular permissions disabled:
|
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 1 |
Audit option | adhoc |
Command or access audited | User-defined audit record |
Information in extrainfo | extrainfo is filled by the text parameter of sp_addauditrecord |
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|