SQL:StmtRecompile Event Class
The SQL:StmtRecompile event class indicates statement-level recompilations caused by all types of batches: stored procedures, triggers, ad hoc batches, and queries. Queries can be submitted by using sp_executesql, dynamic SQL, Prepare methods, Execute methods, or similar interfaces. The SQL:StmtRecompile event class should be used instead of the SP:Recompile event class.
Data column name
Name of the client application that created the connection to an instance of Microsoft SQL Server. This column is populated with the values passed by the application rather than the displayed name of the program
ID assigned by the host computer to the process where the client application is running. This data column is populated if the client provides the process ID.
ID of the database in which the stored procedure is running. Determine the value for a database by using the DB_ID function.
Name of the database in which the stored procedure is running.
The sequence of an event within the request.
Describes the cause of the recompilation:
1 = Schema changed
2 = Statistics changed
3 = Deferred compile
4 = Set option changed
5 = Temp table changed
6 = Remote rowset changed
7 = For Browse permissions changed
8 = Query notification environment changed
9 = Partition view changed
10 = Cursor options changed
11 = Option (recompile) requested
ID of the workload group where the SQL Trace event fires.
Name of the computer on which the client is running which submitted this statement. This data column is populated if the client provides the host name. To determine the host name, use the HOST_NAME function.
Ending offset of the statement within the stored procedure or batch that caused recompilation. Ending offset is -1 if the statement is the last statement in its batch.
Indicates whether the event occurred on a system process or a user process.
1 = system
0 = user
Sequence number of this statement within the batch, if applicable.
Name of the login that submitted this batch.
Security identifier (SID) of the currently logged in user. You can find this information in the sys.server_principals catalog view. Each SID is unique for each login in the server.
The nesting level of the stored procedure call. For example, my_proc_a stored procedure calls my_proc_b. In this case, my_proc_a has a NestLevel of 1, my_proc_b has a NestLevel of 2.
Windows domain to which the user belongs.
Windows user name of connected user.
System-assigned identifier of the object that contains the statement that caused the recompilation. This object can be a stored procedure, trigger, or user-defined function. For ad hoc batches or prepared SQL, ObjectID and ObjectName return a NULL value.
Name of the object identified by ObjectID.
Value that represents the type of object involved in the event. For more information, see ObjectType Trace Event Column.
Starting offset of the statement within the stored procedure or batch that caused recompilation.
ID of the request containing the statement.
Name of the SQL Server being traced.
Login name of the user who originated the session. For example, if you connect to SQL Server using Login1 and execute a statement as Login2, SessionLoginName shows Login1 and LoginName shows Login2. This column displays both SQL Server and Windows logins.
Server process ID of the connection.
64-bit hash based on the text of an ad hoc query or the database and object ID of an SQL object. This value can be passed to sys.dm_exec_sql_text to retrieve the associated SQL text.
Time at which the event started, if available.
Text of the Transact-SQL statement that recompiled.
System-assigned ID of the transaction.
Token that describes the current transaction.