sys.events (Transact-SQL)
針對引發觸發程序或事件通知的每個事件,各包含一個資料列。這些事件代表利用 CREATE TRIGGER 或 CREATE EVENT NOTIFICATION 來建立觸發程序或事件通知時,所指定的事件類型。
資料行名稱 | 資料類型 | 描述 |
---|---|---|
object_id |
int |
觸發程序或事件通知的識別碼。這個值用來搭配 type,以唯一識別資料列。 |
type |
int |
造成引發觸發程序的事件類型。如需事件清單,請參閱下表。 |
type_desc |
nvarchar(60) |
造成引發觸發程序之事件類型的描述。如需事件清單,請參閱下表。 |
is_trigger_event |
bit |
1 = 觸發程序事件。 0 = 通知事件。 |
下表包含事件及其相關類型號碼的清單。
type
type_desc
1
INSERT
2
UPDATE
3
DELETE
21
CREATE_TABLE
22
ALTER_TABLE
23
DROP_TABLE
24
CREATE_INDEX
25
ALTER_INDEX
26
DROP_INDEX
27
CREATE_STATISTICS
28
UPDATE_STATISTICS
29
DROP_STATISTICS
34
CREATE_SYNONYM
36
DROP_SYNONYM
41
CREATE_VIEW
42
ALTER_VIEW
43
DROP_VIEW
51
CREATE_PROCEDURE
52
ALTER_PROCEDURE
53
DROP_PROCEDURE
61
CREATE_FUNCTION
62
ALTER_FUNCTION
63
DROP_FUNCTION
71
CREATE_TRIGGER
72
ALTER_TRIGGER
73
DROP_TRIGGER
74
CREATE_EVENT_NOTIFICATION
76
DROP_EVENT_NOTIFICATION
91
CREATE_TYPE
93
DROP_TYPE
101
CREATE_ASSEMBLY
102
ALTER_ASSEMBLY
103
DROP_ASSEMBLY
131
CREATE_USER
132
ALTER_USER
133
DROP_USER
134
CREATE_ROLE
135
ALTER_ROLE
136
DROP_ROLE
137
CREATE_APPLICATION_ROLE
138
ALTER_APPLICATION_ROLE
139
DROP_APPLICATION_ROLE
141
CREATE_SCHEMA
142
ALTER_SCHEMA
143
DROP_SCHEMA
144
CREATE_LOGIN
145
ALTER_LOGIN
146
DROP_LOGIN
151
CREATE_MESSAGE_TYPE
152
ALTER_MESSAGE_TYPE
153
DROP_MESSAGE_TYPE
154
CREATE_CONTRACT
156
DROP_CONTRACT
157
CREATE_QUEUE
158
ALTER_QUEUE
159
DROP_QUEUE
160
BROKER_QUEUE_DISABLED
161
CREATE_SERVICE
162
ALTER_SERVICE
163
DROP_SERVICE
164
CREATE_ROUTE
165
ALTER_ROUTE
166
DROP_ROUTE
167
GRANT_SERVER
168
DENY_SERVER
169
REVOKE_SERVER
170
GRANT_DATABASE
171
DENY_DATABASE
172
REVOKE_DATABASE
173
QUEUE_ACTIVATION
174
CREATE_REMOTE_SERVICE_BINDING
175
ALTER_REMOTE_SERVICE_BINDING
176
DROP_REMOTE_SERVICE_BINDING
177
CREATE_XML_SCHEMA_COLLECTION
178
ALTER_XML_SCHEMA_COLLECTION
179
DROP_XML_SCHEMA_COLLECTION
181
CREATE_ENDPOINT
182
ALTER_ENDPOINT
183
DROP_ENDPOINT
191
CREATE_PARTITION_FUNCTION
192
ALTER_PARTITION_FUNCTION
193
DROP_PARTITION_FUNCTION
194
CREATE_PARTITION_SCHEME
195
ALTER_PARTITION_SCHEME
196
DROP_PARTITION_SCHEME
197
CREATE_CERTIFICATE
198
ALTER_CERTIFICATE
199
DROP_CERTIFICATE
201
CREATE_DATABASE
202
ALTER_DATABASE
203
DROP_DATABASE
204
ALTER_AUTHORIZATION_SERVER
205
ALTER_AUTHORIZATION_DATABASE
206
CREATE_XML_INDEX
207
ADD_ROLE_MEMBER
208
DROP_ROLE_MEMBER
209
ADD_SERVER_ROLE_MEMBER
210
DROP_SERVER_ROLE_MEMBER
1014
AUDIT_LOGIN
1015
AUDIT_LOGOUT
1020
AUDIT_LOGIN_FAILED
1021
EVENTLOG
1022
ERRORLOG
1025
LOCK_DEADLOCK
1033
EXCEPTION
1034
SP_CACHEMISS
1035
SP_CACHEINSERT
1036
SP_CACHEREMOVE
1037
SP_RECOMPILE
1046
OBJECT_CREATED
1047
OBJECT_DELETED
1055
HASH_WARNING
1059
LOCK_DEADLOCK_CHAIN
1060
LOCK_ESCALATION
1061
OLEDB_ERRORS
1067
EXECUTION_WARNINGS
1069
SORT_WARNINGS
1079
MISSING_COLUMN_STATISTICS
1080
MISSING_JOIN_PREDICATE
1081
SERVER_MEMORY_CHANGE
1082
USERCONFIGURABLE_0
1083
USERCONFIGURABLE_1
1084
USERCONFIGURABLE_2
1085
USERCONFIGURABLE_3
1086
USERCONFIGURABLE_4
1087
USERCONFIGURABLE_5
1088
USERCONFIGURABLE_6
1089
USERCONFIGURABLE_7
1090
USERCONFIGURABLE_8
1091
USERCONFIGURABLE_9
1092
DATA_FILE_AUTO_GROW
1093
LOG_FILE_AUTO_GROW
1094
DATA_FILE_AUTO_SHRINK
1095
LOG_FILE_AUTO_SHRINK
1102
AUDIT_DATABASE_SCOPE_GDR_EVENT
1103
AUDIT_SCHEMA_OBJECT_GDR_EVENT
1104
AUDIT_ADDLOGIN_EVENT
1105
AUDIT_LOGIN_GDR_EVENT
1106
AUDIT_LOGIN_CHANGE_PROPERTY_EVENT
1107
AUDIT_LOGIN_CHANGE_PASSWORD_EVENT
1108
AUDIT_ADD_LOGIN_TO_SERVER_ROLE_EVENT
1109
AUDIT_ADD_DB_USER_EVENT
1110
AUDIT_ADD_MEMBER_TO_DB_ROLE_EVENT
1111
AUDIT_ADD_ROLE_EVENT
1112
AUDIT_APP_ROLE_CHANGE_PASSWORD_EVENT
1114
AUDIT_SCHEMA_OBJECT_ACCESS_EVENT
1115
AUDIT_BACKUP_RESTORE_EVENT
1116
AUDIT_DBCC_EVENT
1117
AUDIT_CHANGE_AUDIT_EVENT
1119
OLEDB_CALL_EVENT
1120
OLEDB_QUERYINTERFACE_EVENT
1121
OLEDB_DATAREAD_EVENT
1122
SHOWPLAN_XML
1125
DEPRECATION_ANNOUNCEMENT
1126
DEPRECATION_FINAL_SUPPORT
1127
EXCHANGE_SPILL_EVENT
1128
AUDIT_DATABASE_MANAGEMENT_EVENT
1129
AUDIT_DATABASE_OBJECT_MANAGEMENT_EVENT
1130
AUDIT_DATABASE_PRINCIPAL_MANAGEMENT_EVENT
1131
AUDIT_SCHEMA_OBJECT_MANAGEMENT_EVENT
1132
AUDIT_SERVER_PRINCIPAL_IMPERSONATION_EVENT
1133
AUDIT_DATABASE_PRINCIPAL_IMPERSONATION_EVENT
1134
AUDIT_SERVER_OBJECT_TAKE_OWNERSHIP_EVENT
1135
AUDIT_DATABASE_OBJECT_TAKE_OWNERSHIP_EVENT
1137
BLOCKED_PROCESS_REPORT
1146
SHOWPLAN_XML_STATISTICS_PROFILE
1148
DEADLOCK_GRAPH
1150
TRACE_FILE_CLOSE
1152
AUDIT_CHANGE_DATABASE_OWNER
1153
AUDIT_SCHEMA_OBJECT_TAKE_OWNERSHIP_EVENT
1155
FT_CRAWL_STARTED
1156
FT_CRAWL_STOPPED
1157
FT_CRAWL_ABORTED
1162
USER_ERROR_MESSAGE
1164
OBJECT_ALTERED
1166
SQL_STMTRECOMPILE
1167
DATABASE_MIRRORING_STATE_CHANGE
重要事項:
Microsoft 支援原則不適用於 SQL Server 2005 的資料庫鏡像功能。資料庫鏡像目前預設為停用,但是可以使用追蹤旗標 1400 做為啟動參數加以啟用,以供評估之用。(如需有關追蹤旗標的詳細資訊,請參閱: 追蹤旗標 (Transact-SQL) .) 資料庫鏡像不可在實際執行環境中使用,而且 Microsoft 支援服務不支援使用資料庫鏡像的資料庫或應用程式。資料庫鏡像文件集包含在 SQL Server 2005 中,僅供評估之用,而 SQL Server 2005 支援及升級的文件集原則不適用於資料庫鏡像文件集。
1168
SHOWPLAN_XML_FOR_QUERY_COMPILE
1169
SHOWPLAN_ALL_FOR_QUERY_COMPILE
1170
AUDIT_SERVER_SCOPE_GDR_EVENT
1171
AUDIT_SERVER_OBJECT_GDR_EVENT
1172
AUDIT_DATABASE_OBJECT_GDR_EVENT
1173
AUDIT_SERVER_OPERATION_EVENT
1175
AUDIT_SERVER_ALTER_TRACE_EVENT
1176
AUDIT_SERVER_OBJECT_MANAGEMENT_EVENT
1177
AUDIT_SERVER_PRINCIPAL_MANAGEMENT_EVENT
1178
AUDIT_DATABASE_OPERATION_EVENT
1180
AUDIT_DATABASE_OBJECT_ACCESS_EVENT
1194
OLEDB_PROVIDER_INFORMATION
1195
MOUNT_TAPE
1196
ASSEMBLY_LOAD
1198
XQUERY_STATIC_TYPE
1199
QN__SUBSCRIPTION
1200
QN__PARAMETER_TABLE
1201
QN__TEMPLATE
1202
QN__DYNAMICS
請參閱
參考
物件目錄檢視 (Transact-SQL)
目錄檢視 (Transact-SQL)