EventClass

  • If you run a trace in SQL Profiler and save the results to a table. One of the columns is EventClass, however it only populates this with an id (INT). Where can I join to so that I get the full description as I would in SQL profiler?

    Thanks in advance.

  • Change the column EventClass to INT.

    Maybe the info is already available in a table/view/schema

    
    
    Create Table EventClassTable(Event_Number varchar(10),Event_Name VarChar(100),Description Varchar(300))
    GO
    Set NoCount on
    GO
    Insert EventClassTable Values('0','Reserved',' ')
    Insert EventClassTable Values('1','Reserved',' ')
    Insert EventClassTable Values('2 ','Reserved',' ')
    Insert EventClassTable Values('3 ','Reserved',' ')
    Insert EventClassTable Values('4 ','Reserved',' ')
    Insert EventClassTable Values('5 ','Reserved',' ')
    Insert EventClassTable Values('6 ','Reserved',' ')
    Insert EventClassTable Values('7 ','Reserved',' ')
    Insert EventClassTable Values('8 ','Reserved',' ')
    Insert EventClassTable Values('9','Reserved',' ')
    Insert EventClassTable Values('10','RPC:Completed','Occurs when a remote procedure call (RPC) has completed.')
    Insert EventClassTable Values('11','RPC:Starting','Occurs when an RPC has started.')
    Insert EventClassTable Values('12','SQL:BatchCompleted','Occurs when a Transact-SQL batch has completed.')
    Insert EventClassTable Values('13','SQL:BatchStarting','Occurs when a Transact-SQL batch has started.')
    Insert EventClassTable Values('14','Login','Occurs when a user successfully logs in to SQL Server.')
    Insert EventClassTable Values('15','Logout','Occurs when a user logs out of SQL Server.')
    Insert EventClassTable Values('16','Attention','Occurs when attention events, such as client-interrupt requests or broken client connections, happen.')
    Insert EventClassTable Values('17','ExistingConnection','Detects all activity by users connected to SQL Server before the trace started.')
    Insert EventClassTable Values('18','ServiceControl','Occurs when the SQL Server service state is modified.')
    Insert EventClassTable Values('19','DTCTransaction','Tracks Microsoft Distributed Transaction Coordinator (MS DTC) coordinated transactions between two or more databases.')
    Insert EventClassTable Values('20','Login Failed','Indicates that a login attempt to SQL Server from a client failed.')
    Insert EventClassTable Values('21','EventLog','Indicates that events have been logged in the Microsoft Windows NT® application log.')
    Insert EventClassTable Values('22','ErrorLog','Indicates that error events have been logged in the SQL Server error log.')
    Insert EventClassTable Values('23','Lock:Released','Indicates that a lock on a resource, such as a page, has been released.')
    Insert EventClassTable Values('24','Lock:Acquired','Indicates acquisition of a lock on a resource, such as a data page.')
    Insert EventClassTable Values('25','Lock:Deadlock','Indicates that two concurrent transactions have deadlocked each other by trying to obtain incompatible locks on resources the other transaction owns. ')
    Insert EventClassTable Values('26','Lock:Cancel','Indicates that the acquisition of a lock on a resource has been canceled (for example, due to a deadlock).')
    Insert EventClassTable Values('27','Lock:Timeout','Indicates that a request for a lock on a resource, such as a page, has timed out due to another transaction holding a blocking lock on the required resource. Time-out is determined by the @@LOCK_TIMEOUT function, and can be set with the SET LOCK_TIMEOUT statement. ')
    Insert EventClassTable Values('28','DOP Event','Occurs before a SELECT, INSERT, or UPDATE statement is executed. ')
    Insert EventClassTable Values('29','Reserved ','Use Event 28 instead.')
    Insert EventClassTable Values('30','Reserved ','Use Event 28 instead.')
    Insert EventClassTable Values('31','Reserved ','Use Event 28 instead.')
    Insert EventClassTable Values('32','Reserved',' ')
    Insert EventClassTable Values('33','Exception','Indicates that an exception has occurred in SQL Server. ')
    Insert EventClassTable Values('34','SP:CacheMiss','Indicates when a stored procedure is not found in the procedure cache.')
    Insert EventClassTable Values('35','SP:CacheInsert','Indicates when an item is inserted into the procedure cache.')
    Insert EventClassTable Values('36','SP:CacheRemove','Indicates when an item is removed from the procedure cache.')
    Insert EventClassTable Values('37','SP:Recompile','Indicates that a stored procedure was recompiled.')
    Insert EventClassTable Values('38','SP:CacheHit','Indicates when a stored procedure is found in the procedure cache.')
    Insert EventClassTable Values('39','SP:ExecContextHit','Indicates when the execution version of a stored procedure has been found in the procedure cache.')
    Insert EventClassTable Values('40','SQL:StmtStarting','Occurs when the Transact-SQL statement has started.')
    Insert EventClassTable Values('41','SQL:StmtCompleted','Occurs when the Transact-SQL statement has completed.')
    Insert EventClassTable Values('42','SP:Starting','Indicates when the stored procedure has started.')
    Insert EventClassTable Values('43','SP:Completed','Indicates when the stored procedure has completed.')
    Insert EventClassTable Values('44','Reserved ','Use Event 40 instead.')
    Insert EventClassTable Values('45','Reserved ','Use Event 41 instead.')
    Insert EventClassTable Values('46','Object:Created','Indicates that an object has been created, such as for CREATE INDEX, CREATE TABLE, and CREATE DATABASE statements.')
    Insert EventClassTable Values('47','Object:Deleted','Indicates that an object has been deleted, such as in DROP INDEX and DROP TABLE statements.')
    Insert EventClassTable Values('48','Reserved',' ')
    Insert EventClassTable Values('49','Reserved',' ')
    Insert EventClassTable Values('50','SQL Transaction','Tracks Transact-SQL BEGIN, COMMIT, SAVE, and ROLLBACK TRANSACTION statements.')
    Insert EventClassTable Values('51','Scan:Started','Indicates when a table or index scan has started.')
    Insert EventClassTable Values('52','Scan:Stopped','Indicates when a table or index scan has stopped.')
    Insert EventClassTable Values('53','CursorOpen','Indicates when a cursor is opened on a Transact-SQL statement by ODBC, OLE DB, or DB-Library.')
    Insert EventClassTable Values('54','Transaction Log','Tracks when transactions are written to the transaction log.')
    Insert EventClassTable Values('55','Hash Warning','Indicates that a hashing operation (for example, hash join, hash aggregate, hash union, and hash distinct) that is not processing on a buffer partition has reverted to an alternate plan. This can occur because of recursion depth, data skew, trace flags, or bit counting.')
    Insert EventClassTable Values('56','Reserved',' ')
    Insert EventClassTable Values('57','Reserved',' ')
    Insert EventClassTable Values('58','Auto Update Stats','Indicates an automatic updating of index statistics has occurred.')
    Insert EventClassTable Values('59','Lock:Deadlock Chain','Produced for each of the events leading up to the deadlock.')
    Insert EventClassTable Values('60','Lock:Escalation','Indicates that a finer-grained lock has been converted to a coarser-grained lock (for example, a row lock escalated or converted to a page lock).')
    Insert EventClassTable Values('61','OLE DB Errors','Indicates that an OLE DB error has occurred.')
    Insert EventClassTable Values('62','Reserved',' ')
    Insert EventClassTable Values('63','Reserved',' ')
    Insert EventClassTable Values('64','Reserved',' ')
    Insert EventClassTable Values('65','Reserved',' ')
    Insert EventClassTable Values('66','Reserved',' ')
    Insert EventClassTable Values('67','Execution Warnings','Indicates any warnings that occurred during the execution of a SQL Server statement or stored procedure.')
    Insert EventClassTable Values('68','Execution Plan','Displays the plan tree of the Transact-SQL statement executed.')
    Insert EventClassTable Values('69','Sort Warnings','Indicates sort operations that do not fit into memory. Does not include sort operations involving the creating of indexes; only sort operations within a query (such as an ORDER BY clause used in a SELECT statement).')
    Insert EventClassTable Values('70','CursorPrepare','Indicates when a cursor on a Transact-SQL statement is prepared for use by ODBC, OLE DB, or DB-Library.')
    Insert EventClassTable Values('71','Prepare SQL','ODBC, OLE DB, or DB-Library has prepared a Transact-SQL statement or statements for use.')
    Insert EventClassTable Values('72','Exec Prepared SQL','ODBC, OLE DB, or DB-Library has executed a prepared Transact-SQL statement or statements.')
    Insert EventClassTable Values('73','Unprepare SQL','ODBC, OLE DB, or DB-Library has unprepared (deleted) a prepared Transact-SQL statement or statements.')
    Insert EventClassTable Values('74','CursorExecute','A cursor previously prepared on a Transact-SQL statement by ODBC, OLE DB, or DB-Library is executed.')
    Insert EventClassTable Values('75','CursorRecompile','A cursor opened on a Transact-SQL statement by ODBC or DB-Library has been recompiled either directly or due to a schema change. Triggered for ANSI and non-ANSI cursors.')
    Insert EventClassTable Values('76','CursorImplicitConversion','A cursor on a Transact-SQL statement is converted by SQL Server from one type to another. Triggered for ANSI and non-ANSI cursors.')
    Insert EventClassTable Values('77','CursorUnprepare','A prepared cursor on a Transact-SQL statement is unprepared (deleted) by ODBC, OLE DB, or DB-Library.')
    Insert EventClassTable Values('78','CursorClose','A cursor previously opened on a Transact-SQL statement by ODBC, OLE DB, or DB-Library is closed.')
    Insert EventClassTable Values('79','Missing Column Statistics','Column statistics that could have been useful for the optimizer are not available.')
    Insert EventClassTable Values('80','Missing Join Predicate','Query that has no join predicate is being executed. This could result in a long-running query.')
    Insert EventClassTable Values('81','Server Memory Change','Microsoft SQL Server memory usage has increased or decreased by either 1 megabyte (MB) or 5 percent of the maximum server memory, whichever is greater.')
    Insert EventClassTable Values('82','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('83','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('84','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('85','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('86','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('87','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('88','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('89','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('90','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('91','User Configurable (0-9)','Event data defined by the user.')
    Insert EventClassTable Values('92','Data File Auto Grow','Indicates that a data file was extended automatically by the server.')
    Insert EventClassTable Values('93','Log File Auto Grow','Indicates that a data file was extended automatically by the server.')
    Insert EventClassTable Values('94','Data File Auto Shrink','Indicates that a data file was shrunk automatically by the server.')
    Insert EventClassTable Values('95','Log File Auto Shrink','Indicates that a log file was shrunk automatically by the server.')
    Insert EventClassTable Values('96','Show Plan Text','Displays the query plan tree of the SQL statement from the query optimizer.')
    Insert EventClassTable Values('97','Show Plan ALL','Displays the query plan with full compile-time details of the SQL statement executed.')
    Insert EventClassTable Values('98','Show Plan Statistics','Displays the query plan with full run-time details of the SQL statement executed.')
    Insert EventClassTable Values('99','Reserved',' ')
    Insert EventClassTable Values('100','RPC Output Parameter','Produces output EventClassTable Values of the parameters for every RPC.')
    Insert EventClassTable Values('101','Reserved',' ')
    Insert EventClassTable Values('102','Audit Statement GDR','Occurs every time a GRANT, DENY, REVOKE for a statement permission is issued by any user in SQL Server.')
    Insert EventClassTable Values('103','Audit Object GDR','Occurs every time a GRANT, DENY, REVOKE for an object permission is issued by any user in SQL Server.')
    Insert EventClassTable Values('104','Audit Add/Drop Login','Occurs when a SQL Server login is added or removed; for sp_addlogin and sp_droplogin.')
    Insert EventClassTable Values('105','Audit Login GDR','Occurs when a Microsoft Windows® login right is added or removed; for sp_grantlogin, sp_revokelogin, and sp_denylogin.')
    Insert EventClassTable Values('106','Audit Login Change Property','Occurs when a property of a login, except passwords, is modified; for sp_defaultdb and sp_defaultlanguage.')
    Insert EventClassTable Values('107','Audit Login Change Password','Occurs when a SQL Server login password is changed. Passwords are not recorded.')
    Insert EventClassTable Values('108','Audit Add Login to Server Role','Occurs when a login is added or removed from a fixed server role; for sp_addsrvrolemember, and sp_dropsrvrolemember.')
    Insert EventClassTable Values('109','Audit Add DB User','Occurs when a login is added or removed as a database user (Windows or SQL Server) to a database; for sp_grantdbaccess, sp_revokedbaccess, sp_adduser, and sp_dropuser.')
    Insert EventClassTable Values('110','Audit Add Member to DB','Occurs when a login is added or removed as a database user (fixed or user-defined) to a database; for sp_addrolemember, sp_droprolemember, and sp_changegroup.')
    Insert EventClassTable Values('111','Audit Add/Drop Role','Occurs when a login is added or removed as a database user to a database; for sp_addrole and sp_droprole.')
    Insert EventClassTable Values('112','App Role Pass Change','Occurs when a password of an application role is changed.')
    Insert EventClassTable Values('113','Audit Statement Permission','Occurs when a statement permission (such as CREATE TABLE) is used.')
    Insert EventClassTable Values('114','Audit Object Permission','Occurs when an object permission (such as SELECT) is used, both successfully or unsuccessfully.')
    Insert EventClassTable Values('115','Audit Backup/Restore','Occurs when a BACKUP or RESTORE command is issued.')
    Insert EventClassTable Values('116','Audit DBCC','Occurs when DBCC commands are issued.')
    Insert EventClassTable Values('117','Audit Change Audit','Occurs when audit trace modifications are made.')
    Insert EventClassTable Values('118','Audit Object Derived Permission','Occurs when a CREATE, ALTER, and DROP object commands are issued.')
    Go
    Set NoCount off
    Go
    Drop table EventClassTable

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply