Returns a description of an audit event.
audit_event_name(event_id)
select * from audit_data where audit_event_name(event) = "Create Table"
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
The following lists the ID and name of each of the audit events:
1 Ad Hoc Audit record
2 Alter Database
3 Alter table
4 BCP In
5 NULL
6 Bind Default
7 Bind Message
8 Bind Rule
9 Create Database
10 Create Table
11 Create Procedure
12 Create Trigger
13 Create Rule
14 Create Default
15 Create Message
16 Create View
17 Access To Database
18 Delete Table
19 Delete View
20 Disk Init
21 Disk Refit
22 Disk Reinit
23 Disk Mirror
24 Disk Unmirror
25 Disk Remirror
26 Drop Database
27 Drop Table
28 Drop Procedure
29 Drop Trigger
30 Drop Rule
31 Drop Default
32 Drop Message
33 Drop View
34 Dump Database
35 Dump Transaction
36 Fatal Error
37 Nonfatal Error
38 Execution Of Stored Procedure
39 Execution Of Trigger
40 Grant Command
41 Insert Table
42 Insert View
43 Load Database
44 Load Transaction
45 Log In
46 Log Out
47 Revoke Command
48 RPC In
49 RPC Out
50 Server Boot
51 Server Shutdown
52 NULL
53 NULL
54 NULL
55 Role Toggling
56 NULL
57 NULL
58 NULL
59 NULL
60 NULL
61 Access To Audit Table
62 Select Table
63 Select View
64 Truncate Table
65 NULL
66 NULL
67 Unbind Default
68 Unbind Rule
69 Unbind Message
70 Update Table
71 Update View
72 NULL
73 Auditing Enabled
74 Auditing Disabled
75 NULL
76 SSO Changed Password
79 NULL
80 Role Check Performed
81 DBCC Command
82 Config
83 Online Database
84 Setuser Command
85 User-defined Function Command
86 Built-in Function
87 Disk Release
88 Set SSA Command
90 Connect Command
91 Reference
92 Command Text
93 JCS Install Command
94 JCS Remove Command
95 Unlock Admin Account
96 Quiesce Database Command
97 Create SQLJ Function
98 Drop SQLJ Function
99 SSL Administration
100 Disk Resize
101 Mount Database
102 Unmount Database
103 Login Command
104 Create Index
105 Drop Index
106 NULL
107 NULL
108 NULL
109 NULL
110 Deploy UDWS
111 Undeploy UDWS
115 Password Administration
select in Reference Manual: Commands
sp_audit in Reference Manual: Procedures
ANSI SQL – compliance level: Transact-SQL extension.
Any user can execute audit_event_name.