The TSQL event classes can be used to monitor the execution and completion of a remote procedure call (RPC), a batch, and a Transact-SQL statement.
Event class | Description |
---|---|
RPC:Completed | RPC has completed. |
RPC:Starting | RPC has started. |
SQL:BatchCompleted | Transact-SQL batch has completed. |
SQL:BatchStarting | Transact-SQL batch has started. |
SQL:StmtCompleted | Transact-SQL statement has completed. |
SQL:StmtStarting | Transact-SQL statement has started. |
By monitoring the TSQL event classes and monitoring the events using single stepping, you can monitor your application queries. The SQL:BatchStarting event class will show the Transact-SQL submitted in a batch, while the SQL:StmtStarting event class shows the individual statement within a batch. By replaying the SQL:BatchCompleted and RPC:Completed event classes, any results returned by the batch or RPC are displayed and can be checked to ensure they match the results you are expecting.
Monitoring the Start Time, End Time, and Duration default data columns shows when the events start and complete, and how long each RPC, batch, or statement takes to complete. By grouping events based on the Duration default data column, you can easily determine the longest running queries. Monitoring the NT User Name and SQL User Name default data columns can also identify users who submit these queries.
These are the event-specific data columns for TSQL event category.
Event class | Data column | Description |
---|---|---|
RPC:Completed | Text | Text of the RPC |
RPC:Starting | Text | Text of the RPC |
SQL:BatchCompleted | Text | Text of the batch |
SQL:BatchStarting | Text | Text of the batch |
SQL:StmtCompleted | Integer Data | Actual rows returned by the statement |
Text | Text of the statement that was executed | |
SQL:StmtStarting | Text | Text of the statement that is about to be executed |