SQL:StmtRecompile, clase de eventosSQL:StmtRecompile Event Class
Se aplica a:Applies to: SQL ServerSQL Server (todas las versiones admitidas)
SQL ServerSQL Server (all supported versions)
Azure SQL DatabaseAzure SQL Database
Azure SQL DatabaseAzure SQL Database
SQL ServerSQL Server (todas las versiones admitidas)
SQL ServerSQL Server (all supported versions)
Azure SQL DatabaseAzure SQL Database
Azure SQL DatabaseAzure SQL Database
La clase de eventos SQL:StmtRecompile indica recopilaciones de nivel de instrucción producidas por lotes de todos los tipos: procedimientos almacenados, desencadenadores, lotes ad hoc y consultas.The SQL:StmtRecompile event class indicates statement-level recompilations caused by all types of batches: stored procedures, triggers, ad hoc batches, and queries. Las consultas pueden enviarse mediante sp_executesql, SQL dinámico, métodos Prepare, métodos Execute u otras interfaces similares.Queries can be submitted by using sp_executesql, dynamic SQL, Prepare methods, Execute methods, or similar interfaces. Debería usarse la clase de eventos SQL:StmtRecompile en lugar de la clase de eventos SP:Recompile.The SQL:StmtRecompile event class should be used instead of the SP:Recompile event class.
Columnas de datos de la clase de eventosSQL:StmtRecompileSQL:StmtRecompile Event Class Data Columns
Nombre de columna de datosData column name | Tipo de datosData type | DescripciónDescription | Identificador de columnaColumn ID | FiltrableFilterable |
---|---|---|---|---|
ApplicationNameApplicationName | nvarcharnvarchar | Nombre de la aplicación cliente que ha creado la conexión a una instancia de MicrosoftMicrosoft SQL ServerSQL Server.Name of the client application that created the connection to an instance of MicrosoftMicrosoft SQL ServerSQL Server. Esta columna se llena con los valores que pasa la aplicación en lugar de llenarse con el nombre que se muestra del programa.This column is populated with the values passed by the application rather than the displayed name of the program | 1010 | SíYes |
ClientProcessIDClientProcessID | intint | Identificador que el equipo host asigna al proceso en el que se ejecuta la aplicación cliente.ID assigned by the host computer to the process where the client application is running. Esta columna de datos se llena si el cliente proporciona el Id. de proceso.This data column is populated if the client provides the process ID. | 99 | SíYes |
DatabaseIDDatabaseID | intint | Id. de la base de datos en que se ejecuta el procedimiento almacenado.ID of the database in which the stored procedure is running. Determina el valor de una base de datos mediante la función DB_ID.Determine the value for a database by using the DB_ID function. | 33 | SíYes |
DatabaseNameDatabaseName | nvarcharnvarchar | Nombre de la base de datos en la que se ejecuta el procedimiento almacenado.Name of the database in which the stored procedure is running. | 3535 | SíYes |
EventSequenceEventSequence | intint | Secuencia de un evento determinado en la solicitud.The sequence of an event within the request. | 5151 | NoNo |
EventSubClassEventSubClass | intint | Describe la causa de la recompilación:Describes the cause of the recompilation: 1 = Esquema cambiado1 = Schema changed 2 = Estadísticas cambiadas2 = Statistics changed 3 = Compilación diferida3 = Deferred compile 4 = Opción establecida cambiada4 = Set option changed 5 = Tabla temporal cambiada5 = Temp table changed 6 = Conjunto de filas remoto cambiado6 = Remote rowset changed 7 = Permisos For Browse cambiados7 = For Browse permissions changed 8 = Entorno de notificación de consultas cambiado8 = Query notification environment changed 9 = Vista de partición cambiada9 = Partition view changed 10 = Opciones de cursor cambiadas10 = Cursor options changed 11 = Opción (volver a compilar) solicitada11 = Option (recompile) requested |
2121 | SíYes |
GroupIDGroupID | intint | Id. del grupo de carga de trabajo donde se activa el evento de Seguimiento de SQL.ID of the workload group where the SQL Trace event fires. | 6666 | SíYes |
HostNameHostName | nvarcharnvarchar | Nombre del equipo en el que se ejecuta el cliente y que ha enviado esta instrucción.Name of the computer on which the client is running which submitted this statement. Esta columna de datos se rellena si el cliente proporciona el nombre del host.This data column is populated if the client provides the host name. Para determinar el nombre del host, utilice la función HOST_NAME.To determine the host name, use the HOST_NAME function. | 88 | SíYes |
IntegerData2IntegerData2 | intint | Desplazamiento final de la instrucción en el procedimiento almacenado o proceso por lotes que causó la recompilación.Ending offset of the statement within the stored procedure or batch that caused recompilation. El desplazamiento final es -1 si la instrucción es la última de su lote.Ending offset is -1 if the statement is the last statement in its batch. | 5555 | SíYes |
IsSystemIsSystem | intint | Indica si el evento ha ocurrido en un proceso del sistema o en un proceso de usuario.Indicates whether the event occurred on a system process or a user process. 1 = sistema1 = system 0 = usuario0 = user |
6060 | SíYes |
LineNumberLineNumber | intint | Número de secuencia de esta instrucción dentro del lote, si procede.Sequence number of this statement within the batch, if applicable. | 55 | SíYes |
LoginNameLoginName | nvarcharnvarchar | Nombre del inicio de sesión que ha enviado este lote.Name of the login that submitted this batch. | 1111 | SíYes |
LoginSidLoginSid | imageimage | SID (número de identificación de seguridad) del usuario que ha iniciado la sesión.Security identifier (SID) of the currently logged in user. Puede buscar esta información en la vista de catálogo sys.server_principals.You can find this information in the sys.server_principals catalog view. Cada SID es único para cada inicio de sesión en el servidor.Each SID is unique for each login in the server. | 4141 | SíYes |
NestLevelNestLevel | intint | El nivel de anidamiento de la llamada del procedimiento almacenado.The nesting level of the stored procedure call. Por ejemplo, el procedimiento almacenado my_proc_a llama a my_proc_b.For example, my_proc_a stored procedure calls my_proc_b. En este caso, my_proc_a tiene un NestLevel de 1 y my_proc_b tiene un NestLevel de 2.In this case, my_proc_a has a NestLevel of 1, my_proc_b has a NestLevel of 2. | 2929 | SíYes |
NTDomainNameNTDomainName | nvarcharnvarchar | Dominio de Windows al que pertenece el usuario.Windows domain to which the user belongs. | 77 | SíYes |
NTUserNameNTUserName | nvarcharnvarchar | Nombre de usuario de Windows perteneciente al usuario conectado.Windows user name of connected user. | 66 | SíYes |
ObjectIDObjectID | intint | Identificador asignado por el sistema del objeto que contiene la instrucción que produce la recompilación.System-assigned identifier of the object that contains the statement that caused the recompilation. Este objeto puede ser un procedimiento almacenado, un desencadenador o una función definida por el usuario.This object can be a stored procedure, trigger, or user-defined function. Para lotes ad hoc o instrucciones SQL preparadas, ObjectID y ObjectName devuelven un valor NULL.For ad hoc batches or prepared SQL, ObjectID and ObjectName return a NULL value. | 2222 | SíYes |
ObjectNameObjectName | nvarcharnvarchar | Nombre del objeto identificado por ObjectID.Name of the object identified by ObjectID. | 3434 | SíYes |
ObjectTypeObjectType | intint | Valor que representa el tipo de objeto implicado en el evento.Value that represents the type of object involved in the event. Para más información, consulte ObjectType Trace Event Column.For more information, see ObjectType Trace Event Column. | 2828 | SíYes |
OffsetOffset | intint | Desplazamiento inicial de la instrucción en el procedimiento almacenado o proceso por lotes que causó la recompilación.Starting offset of the statement within the stored procedure or batch that caused recompilation. | 6161 | SíYes |
RequestIDRequestID | intint | Identificador de la solicitud que contiene la instrucción.ID of the request containing the statement. | 4949 | SíYes |
nombreDeServidorServerName | nvarcharnvarchar | Nombre de SQL ServerSQL Server del que se realiza un seguimiento.Name of the SQL ServerSQL Server being traced. | 2626 | NoNo |
SessionLoginNameSessionLoginName | nvarcharnvarchar | Nombre de inicio de sesión del usuario que originó la sesión.Login name of the user who originated the session. Por ejemplo, si se conecta a SQL ServerSQL Server usando inicioDeSesión1 y ejecuta una instrucción como inicioDeSesión2, SessionLoginName muestra inicioDeSesión1 y LoginName muestra inicioDeSesión2.For example, if you connect to SQL ServerSQL Server using Login1 and execute a statement as Login2, SessionLoginName shows Login1 and LoginName shows Login2. En esta columna se muestran los inicios de sesión de SQL ServerSQL Server y de Windows.This column displays both SQL ServerSQL Server and Windows logins. | 6464 | SíYes |
SPIDSPID | intint | Id. de proceso de servidor de la conexión.Server process ID of the connection. | 1212 | SíYes |
SqlHandleSqlHandle | varbinaryvarbinary | Hash de 64 bits basado en el texto de una consulta ad hoc o en el Id. de base de datos y de objeto de un objeto SQL.64-bit hash based on the text of an ad hoc query or the database and object ID of an SQL object. Este valor puede pasarse a sys.dm_exec_sql_text para recuperar el texto SQL asociado.This value can be passed to sys.dm_exec_sql_text to retrieve the associated SQL text. | 6363 | NoNo |
StartTimeStartTime | datetimedatetime | Hora a la que se inició el evento, si está disponible.Time at which the event started, if available. | 1414 | SíYes |
TextDataTextData | ntextntext | Texto de la instrucción Transact-SQL que se ha recompilado.Text of the Transact-SQL statement that recompiled. | 11 | SíYes |
TransactionIDTransactionID | bigintbigint | Id. de la transacción asignado por el sistema.System-assigned ID of the transaction. | 44 | SíYes |
XactSequenceXactSequence | bigintbigint | Token que describe la transacción actual.Token that describes the current transaction. | 5050 | SíYes |
Consulte tambiénSee Also
SP:Recompile (clase de eventos) SP:Recompile Event Class
sp_trace_setevent (Transact-SQL)sp_trace_setevent (Transact-SQL)