audit_event_name
Description
Returns
a description of an audit event.
Syntax
audit_event_name(event_id)
Parameters
- event_id
- is the number of an audit event. 
Examples
Example 1
Queries the audit trail for table creation events:
select * from audit_data where audit_event_name(event) = "Create Table"
Example 2
Obtains current audit event values. See the Usage
section below for a complete list of audit values and their descriptions.
create table #tmp(event_id int, description varchar(255))
go
declare @a int
select @a=1
while (@a<120)
begin
      insert #tmp values (@a, audit_event_name(@a))
      select @a=@a + 1
end
select * from #tmp
go
-----------------------------------------
event_id    description
---------   -------------------
      1     Ad hoc Audit Record
      2     Alter Database
      ...
      104   Create Index
      105   Drop Index
Usage
The following lists the ID and name of each of the audit events:
| 1    Ad Hoc Audit record2    Alter Database3    Alter table4    BCP In5    NULL6    Bind Default7    Bind Message8    Bind Rule9    Create Database10  Create Table11  Create Procedure12  Create Trigger13  Create Rule14  Create Default15  Create Message16  Create View17  Access To Database18  Delete Table19  Delete View20  Disk Init21  Disk Refit22  Disk Reinit23  Disk Mirror24  Disk Unmirror25  Disk Remirror26  Drop Database27  Drop Table28  Drop Procedure29  Drop Trigger30  Drop Rule31  Drop Default32  Drop Message33  Drop View34  Dump Database35  Dump Transaction36  Fatal Error37  Nonfatal Error
 |  | 74
 Auditing Disabled75  NULL76  SSO Changed Password79  NULL80  Role Check Performed81  DBCC Command82  Config83  Online Database84  Setuser Command85  User-defined Function Command86  Built-in Function87  Disk Release88  Set SSA Command90  Connect Command91  Reference92  Command Text93 JCS Install Command94 JCS Remove Command95  Unlock Admin Account96  Quiesce Database Command97  Create SQLJ Function98  Drop SQLJ Function99  SSL Administration100 Disk Resize101 Mount Database102 Unmount Database103 Login Command104 Create Index105 Drop Index106 NULL107 NULL108 NULL109 NULL110 Deploy UDWS111 Undeploy UDWS115 Password Administration
 | 
 Adaptive Server does not log events if audit_event_name returns
NULL.
Adaptive Server does not log events if audit_event_name returns
NULL.
 
Standards
ANSI SQL – compliance level: Transact-SQL extension.
Permissions
Any user can execute audit_event_name.
See also
Commands   select, sp_audit