Microsoft® SQL Server™ provides a set of events (event classes) that can be used by SQL Server Profiler to monitor activity in SQL Server. An event class is an event generated within the SQL Server engine, such as the start of the execution of a stored procedure, a successful or failed connection to SQL Server, a transaction, or a lock time-out. Within SQL Server Profiler, event classes are grouped into event categories (collections) that describe the type of event class. For example, all lock event classes are grouped within the Locks event category.
Note Grouping event classes into categories aids usability and understanding within the SQL Server Profiler interface. There is no corresponding engine event that maps to the event category.
These are the SQL Server event categories.
Event category | Description |
---|---|
Cursors | Collection of event classes that are produced by cursor operations. |
Error and Warning | Collection of event classes that are produced when a SQL Server error or warning occurs. For example, an error during the compilation of a stored procedure or an exception in SQL Server. |
Locks | Collection of database object locking event classes. |
Misc. | Collection of miscellaneous event classes that do not fit into any of the other event categories. |
Objects | Collection of event classes that are produced when database objects are created, opened, closed, dropped, or deleted. |
Scans | Collection of database object scan event classes. Database objects that can be scanned include tables and indexes. |
Sessions | Collection of event classes that are produced by clients connecting to and disconnecting from SQL Server. |
SQL Operators | Collection of event classes that are produced from the execution of SQL data manipulation language (DML) operators. |
Stored Procedures | Collection of event classes that are produced by the execution of stored procedures. |
Transactions | Collection of event classes that are produced by the execution of Microsoft Distributed Transaction Coordinator (MS DTC) or SQL transactions, or by writing to the transaction log. |
TSQL | Collection of event classes that are produced by the execution of Transact-SQL passed to SQL Server from the client. |
User Configurable | Collection of user-configurable event classes. |
The data columns describe the data that is collected for each of the event classes captured in the trace. Because the event class determines the type of data that is collected in the trace, not all data columns are applicable to all event classes. For example, the Binary Data data column, when captured for the Lock:Acquired event class, contains the value of the locked page ID or row but has no value for the Disconnect event class. Default data columns are automatically populated for all event classes.
The data displayed in SQL Server Profiler can either be displayed in the order the events occur or grouped based on one or a combination of data columns. This is similar to the GROUP BY clause in Transact-SQL. Grouping events allows you to view events by the type of data displayed. For example, grouping events by SQL User Name and Duration allows you to view all monitored events grouped by user, and then subgrouped by duration. This allows you to easily view which user events are taking the longest amount of time to execute.
Data column | Description |
---|---|
Application Name (1) | Name of the client application that created the connection to SQL Server. This column is populated with the values passed by the application rather than the displayed name of the program. |
Binary Data | Binary value dependent on the event class captured in the trace. |
Connection ID (1) | ID assigned by SQL Server to the connection that is established by the client application. Events produced by system processes may not have a connection ID. |
CPU (1) | Amount of CPU time (in milliseconds) that is used by the event. |
Database ID (1) | ID of the database specified by the USE database statement, or the default database if no USE database statement has been issued for a given connection. SQL Server Profiler displays the name of the database if the Server Name data column is captured in the trace and the server is available. The value for a database can be determined by using the DB_ID function. |
Duration (1) | Amount of elapsed time (in milliseconds) taken by the event. |
End Time (1) | Time at which the event ended. This column is not populated for starting event classes, such as SQL:BatchStarting or SP:Starting. |
Event Class (1) | Type of event class that is captured. |
Event Sub Class | Type of event subclass. This data column is not populated for all event classes. |
Host Name | Name of the computer on which the client is running. This data column is populated if the host name is provided by the client. To determine the host name, use the HOST_NAME function. |
Host Process ID | ID assigned by the host computer to the process in which the client application is running. This data column is populated if the host process ID is provided by the client. To determine the host ID, use the HOST_ID function. |
Index ID | ID for the index on the object that is affected by the event. To determine the index ID for an object, use the indid column of the sysindexes system table. |
Integer Data | Integer value dependent on the event class that is captured in the trace. |
NT Domain Name (1) | Microsoft Windows NT® domain to which the user belongs. |
NT User Name (1) | Windows NT username. |
Object ID | System-assigned ID of the object. |
Reads | Number of logical disk reads that are performed by the server on behalf of the event. |
Server Name (1) | Name of the SQL Server that is traced. |
Severity | Severity level of an exception. |
SPID (1) | Server Process ID assigned by SQL Server to the process associated with the client. |
SQL User Name (1) | SQL Server username of the client. |
Start Time (1) | Time at which the event started, when available. |
Text | Text value dependent on the event class that is captured in the trace. |
Transaction ID | System-assigned ID of the transaction. |
Writes | Number of physical disk writes performed by the server on behalf of the event. |
1 Default data column, which is automatically populated for all event classes. |
When viewing the captured data in a trace, if SQL Server Profiler can connect to the computer running SQL Server where the trace data was captured from, it will try to populate the Database ID, Object ID, and Index ID data columns with the names of the database, object, and index respectively. Otherwise, identification numbers (IDs) will be displayed instead.