Re: How to get list of EventClasses in MSSQLServer2000



Hi

Taken fro Vyas's web site

CREATE TABLE [dbo].[Events] (
[EventClass] [smallint] NOT NULL ,
[EventName] [varchar] (50) NOT NULL ,
[EventDescription] [varchar] (300) NULL
) ON [PRIMARY]
GO

CREATE UNIQUE CLUSTERED INDEX [UCI_Events_EventClass] ON
[dbo].[Events]([EventClass]) ON [PRIMARY]
GO

INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(44,'SP:StmtStarting','SQL
statement inside a stored procedure is starting.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(45,'SP:StmtCompleted','SQL
statement inside a stored procedure has completed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(46,'Object:Created','Indicates
that an object has been created, such as for CREATE INDEX, CREATE TABLE, and
CREATE DATABASE statements.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(47,'Object:Deleted','Indicates
that an object has been deleted, such as in DROP INDEX and DROP TABLE
statements.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(48,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(49,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(50,'SQL
Transaction','Tracks Transact-SQL BEGIN, COMMIT, SAVE, and ROLLBACK
TRANSACTION statements.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(51,'Scan:Started','Indicates
when a table or index scan has started.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(52,'Scan:Stopped','Indicates
when a table or index scan has stopped.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(53,'CursorOpen','Indicates
when a cursor is opened on a Transact-SQL statement by ODBC, OLE DB, or
DB-Library.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(54,'Transaction
Log','Tracks when transactions are written to the transaction log.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(56,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(57,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(58,'Auto Update
Stats','Indicates an automatic updating of index statistics has occurred.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(59,'Lock:Deadlock
Chain','Produced for each of the events leading up to the deadlock.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(61,'OLE DB
Errors','Indicates that an OLE DB error has occurred.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(62,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(63,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(64,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(65,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(66,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(67,'Execution
Warnings','Indicates any warnings that occurred during the execution of a
SQL Server statement or stored procedure.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(68,'Execution
Plan','Displays the plan tree of the Transact-SQL statement executed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(70,'CursorPrepare','Indicates
when a cursor on a Transact-SQL statement is prepared for use by ODBC, OLE
DB, or DB-Library.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(71,'Prepare SQL','ODBC,
OLE DB, or DB-Library has prepared a Transact-SQL statement or statements
for use.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(72,'Exec Prepared
SQL','ODBC, OLE DB, or DB-Library has executed a prepared Transact-SQL
statement or statements.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(73,'Unprepare
SQL','ODBC, OLE DB, or DB-Library has unprepared (deleted) a prepared
Transact-SQL statement or statements.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(74,'CursorExecute','A
cursor previously prepared on a Transact-SQL statement by ODBC, OLE DB, or
DB-Library is executed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(76,'CursorImplicitConversion','A
cursor on a Transact-SQL statement is converted by SQL Server from one type
to another.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(77,'CursorUnprepare','A
prepared cursor on a Transact-SQL statement is unprepared (deleted) by ODBC,
OLE DB, or DB-Library.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(78,'CursorClose','A
cursor previously opened on a Transact-SQL statement by ODBC, OLE DB, or
DB-Library is closed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(79,'Missing Column
Statistics','Column statistics that could have been useful for the optimizer
are not available.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(80,'Missing Join
Predicate','Query that has no join predicate is being executed. This could
result in a long-running query.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(82,'User Configurable
(0)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(83,'User Configurable
(1)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(84,'User Configurable
(2)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(85,'User Configurable
(3)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(86,'User Configurable
(4)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(87,'User Configurable
(5)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(88,'User Configurable
(6)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(89,'User Configurable
(7)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(90,'User Configurable
(8)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(91,'User Configurable
(9)','Event data defined by the user.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(92,'Data File Auto
Grow','Indicates that a data file was extended automatically by the
server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(93,'Log File Auto
Grow','Indicates that a data file was extended automatically by the
server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(94,'Data File Auto
Shrink','Indicates that a data file was shrunk automatically by the
server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(95,'Log File Auto
Shrink','Indicates that a log file was shrunk automatically by the server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(96,'Show Plan
Text','Displays the query plan tree of the SQL statement from the query
optimizer.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(97,'Show Plan
ALL','Displays the query plan with full compile-time details of the SQL
statement executed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(98,'Show Plan
Statistics','Displays the query plan with full run-time details of the SQL
statement executed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(99,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(100,'RPC Output
Parameter','Produces output values of the parameters for every RPC.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(101,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(104,'Audit Add/Drop
Login','Occurs when a SQL Server login is added or removed; for sp_addlogin
and sp_droplogin.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(106,'Audit Login Change
Property','Occurs when a property of a login, except passwords, is modified;
for sp_defaultdb and sp_defaultlanguage.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(107,'Audit Login Change
Password','Occurs when a SQL Server login password is changed.Passwords are
not recorded.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(112,'App Role Pass
Change','Occurs when a password of an application role is changed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(113,'Audit Statement
Permission','Occurs when a statement permission (such as CREATE TABLE) is
used.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(114,'Audit Object
Permission','Occurs when an object permission (such as SELECT) is used, both
successfully or unsuccessfully.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(115,'Audit
Backup/Restore','Occurs when a BACKUP or RESTORE command is issued.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(116,'Audit DBCC','Occurs
when DBCC commands are issued.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(117,'Audit Change
Audit','Occurs when audit trace modifications are made.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(118,'Audit Object
Derived Permission','Occurs when a CREATE, ALTER, and DROP object commands
are issued.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(0,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(1,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(2,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(3,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(4,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(5,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(6,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(7,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(8,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(9,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(10,'RPC:Completed','Occurs
when a remote procedure call (RPC) has completed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(11,'RPC:Starting','Occurs
when an RPC has started.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(12,'SQL:BatchCompleted','Occurs
when a Transact-SQL batch has completed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(13,'SQL:BatchStarting','Occurs
when a Transact-SQL batch has started.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(14,'Login','Occurs when
a user successfully logs in to SQL Server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(15,'Logout','Occurs when
a user logs out of SQL Server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(16,'Attention','Occurs
when attention events, such as client-interrupt requests or broken client
connections, happen.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(17,'ExistingConnection','Detects
all activity by users connected to SQL Server before the trace started.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(18,'ServiceControl','Occurs
when the SQL Server service state is modified.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(19,'DTCTransaction','Tracks
Microsoft Distributed Transaction Coordinator (MS DTC) coordinated
transactions between two or more databases.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(20,'Login
Failed','Indicates that a login attempt to SQL Server from a client
failed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(21,'EventLog','Indicates
that events have been logged in the Microsoft Windows NT® application
log.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(22,'ErrorLog','Indicates
that error events have been logged in the SQL Server error log.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(23,'Lock:Released','Indicates
that a lock on a resource, such as a page, has been released.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(24,'Lock:Acquired','Indicates
acquisition of a lock on a resource, such as a data page.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(26,'Lock:Cancel','Indicates
that the acquisition of a lock on a resource has been canceled (for example,
due to a deadlock).')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])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 INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(28,'DOP Event','Occurs
before a SELECT, INSERT, or UPDATE statement is executed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(29,'Reserved','Use Event
28 instead.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(30,'Reserved','Use Event
28 instead.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(31,'Reserved','Use Event
28 instead.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(32,'Reserved','')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(33,'Exception','Indicates
that an exception has occurred in SQL Server.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(34,'SP:CacheMiss','Indicates
when a stored procedure is not found in the procedure cache.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(35,'SP:CacheInsert','Indicates
when an item is inserted into the procedure cache.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(36,'SP:CacheRemove','Indicates
when an item is removed from the procedure cache.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(37,'SP:Recompile','Indicates
that a stored procedure was recompiled.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(38,'SP:CacheHit','Indicates
when a stored procedure is found in the procedure cache.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(39,'SP:ExecContextHit','Indicates
when the execution version of a stored procedure has been found in the
procedure cache.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(40,'SQL:StmtStarting','Occurs
when the Transact-SQL statement has started.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(41,'SQL:StmtCompleted','Occurs
when the Transact-SQL statement has completed.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(42,'SP:Starting','Indicates
when the stored procedure has started.')
INSERT INTO [events]
([EventClass],[EventName],[EventDescription])VALUES(43,'SP:Completed','Indicates
when the stored procedure has completed.')


"SomaSekhar" <SomaSekhar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1F3FC9E1-32F3-4B9E-A2A4-1C3FF2B30588@xxxxxxxxxxxxxxxx
Hi Uri,

What is the better solution for this. How to get list of EventId's and
EventClass name on SQL Server 2000. Because i am using
fn_trace_gettrable('trace file name', default), it's giving in EventClass
as
a EventID. Insted of EventID i need EventClass name. How achive this in
SQL
Server 2000. In SQL Server 2005 i am using INNER JOIN condion on
sys.trace_events i am comparing both event ID's i am getiting EventClass
name. Please check this query,

--This will work on MS SQL Server 2005
SELECT TextData,trace_event_id,category_id,name
FROM fn_trace_gettable('E:\Somu\trace_events.trc', default) EventLog
INNER JOIN sys.trace_events EventID ON EventLog.EventClass =
EventID.trace_event_id

NOTE : in the above query "E:\Somu\trace_events.trc - Insted of this give
give Ur trace file location"

What is the equallent Query in MS SQL Server 2000.

Thanks & Regards
-SomaSekhar

"Uri Dimant" wrote:

Hi

I'm afraid you cannot get it in SQL Server 2000
sp_trace_setevent stored procedure has a parameter EventId and there is
a
list of event numbers (See BOL)




"SomaSekhar" <SomaSekhar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6E597B1F-590C-403B-A964-9EF67AF5D923@xxxxxxxxxxxxxxxx
Hi,

I am working on MS SQL Sever 2005 & 2000; I am interest on audit
traces.
In MSSQL 2005 I am using built in system table like sys.trace_events I
am
able to see list of events. When executing the following query.

SELECT * FROM sys.trace_events;

Is there any equal lent table available on MSSQLServer 2000. I tried a
lot, I am unable to get. Please any body help on this issue.

Thanks & Regards
-SomaSekhar





.



Relevant Pages

  • Re: How to get list of EventClasses in MSSQLServer2000
    ... out using this procedure any system tables is available on SQL Server ... Errors','Indicates that an OLE DB error has occurred.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... GDR','Occurs when a Microsoft Windows® login right is added or removed; ...
    (microsoft.public.sqlserver.security)
  • Re: Limiting views on data in a table
    ... >returns the Windows login the user uses to connect to SQL Server. ... >use it in the WHERE clause of your single stored procedure for everybody to ... pass the login name as a parameter in the stored procedure). ...
    (microsoft.public.sqlserver.security)
  • Re: SQL Server 2005: Checking if Login is connected to any databas
    ... there is no such stored procedure. ... SQL Server 2005 allows dropping login that has mapped users in database. ...
    (microsoft.public.sqlserver.security)
  • RE: Domain name change for user group security
    ... After you move a database from one server that is running SQL ... Make sure that there is a login in the sysxlogins table in the ... To add an integrated SQL Server login, ... but I'm not sure if there is a stored procedure ...
    (microsoft.public.sqlserver.security)
  • Re: Accessing FoxPro Free Table
    ... which the SQL Server service is running. ... account, ... > If you are creating a stored procedure and you want> to make sure that the procedure definition cannot be> viewed by other users, you can use the WITH ENCRYPTION> clause. ... The procedure definition is then stored in an> unreadable form. ...
    (microsoft.public.data.odbc)