
Chapter 12: Changes to Global Variables, Commands, and Stored Procedures
audit_event_name
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
Example 1
Queries the audit trail for table creation events.
select * from audit_data where audit_event_name(event)
= “Create Table”
Example 2
Example 2
Obtains current audit event values. See Table 12-3 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
Table 12-3 lists
the ID and name of each of the 105 audit events.
Table 12-3: Audit events
Audit number and description
|
1 Ad hoc audit record
|
36 Fatal error
|
71 Update view
|
2 Alter database
|
37 Nonfatal error
|
72 NULL
|
3 Alter table
|
38 Execution of stored procedure
|
73 Auditing enabled
|
4 BCP in
|
39 Execution of trigger
|
74 Auditing disabled
|
5 NULL
|
40 Grant command
|
75 NULL
|
6 Bind default
|
41 Insert table
|
76 SSO changed password
|
7 Bind message
|
42 Insert view
|
77 Table change
|
8 Bind rule
|
43 Load database
|
78 Audit option change
|
9 Create database
|
44 Load transaction
|
79 NULL
|
10 Create table
|
45 Log in
|
80 Role check performed
|
11 Create procedure
|
46 Log out
|
81 DBCC command
|
12 Create trigger
|
47 Revoke command
|
82 Config
|
13 Create rule
|
48 RPC in
|
83 Online database
|
14 Create default
|
49 RPC out
|
84 Setuser command
|
15 Create message
|
50 Server boot
|
85 UDR command
|
16 Create view
|
51 Server shutdown
|
86 Builtin function
|
17 Access to database
|
52 Curread modification
|
87 Disk release
|
18 Delete table
|
53 Curwrite modification
|
88 Set SSA command
|
19 Delete view
|
54 Update mode modification
|
89 Kill/terminate command
|
20 Disk init
|
55 Role toggling
|
90 Connect command
|
21 Disk refit
|
56 NULL
|
91 Reference
|
22 Disk reinit
|
57 NULL
|
92 Command text
|
23 Disk mirror
|
58 Truncation of audit table
|
93 JCS install command
|
24 Disk unmirror
|
59 NULL
|
94 JCS remove command
|
25 Disk remirror
|
60 NULL
|
95 Unlock admin account
|
26 Drop database
|
61 Access to audit table
|
96 Quiesce database command
|
27 Drop table
|
62 Select table
|
97 Create SQLJ function
|
28 Drop procedure
|
63 Select view
|
98 Drop SQLJ function
|
29 Drop trigger
|
64 Truncate table
|
99 SSL administration
|
30 Drop rule
|
65 Trusted procedure execution
|
100 Disk resize
|
31 Drop default
|
66 Trusted trigger execution
|
101 Mount database
|
32 Drop message
|
67 Unbind default
|
102 Unmount database
|
33 Drop view
|
68 Unbind rule
|
103 Login command
|
34 Dump database
|
69 Unbind message
|
104 Create index
|
35 Dump transaction
|
70 Update table
|
105 Drop index
|
Standards
ANSI SQL – compliance level: Transact-SQL extension.
Permissions
Any user can execute audit_event_name.
See also
select, sp_audit
Copyright © 2004. Sybase Inc. All rights reserved.
|
|
View this book as PDF 