Database Reference
In-Depth Information
The set of available columns changes based on the SQL Server version in use. Figure 28-6 shows the output of the
query in SQL Server 2008 and Figure 28-7 shows it in SQL Server 2012 and SQL Server 2014. It is worth noting that the
VERSION column in the event data is different in those cases.
Figure 28-6. sql_statement_completed event columns in SQL Server 2008
Figure 28-7. sql_statement_completed event columns in SQL Server 2012 and 2014
Predicates
Predicates define Boolean conditions when an event needs to be fired. For example, if you want to collect information
about CPU-intensive queries, you can define a predicate on the cpu_time column of the sql_statement_completed
event, capturing only the statements with CPU time, which exceed some predefined threshold.
Even though predicates look very similar to column filters in SQL Trace, there is a subtle difference between
them. SQL Trace evaluates column filters after an event is collected and passed to Trace Controller. In contrast,
Extended Events collect the minimally required amount of data to evaluate predicates and do not execute actions nor
fire events if the predicates were evaluated as False .
Predicates can be defined against the event data columns or global attributes, such as session_id , database_id ,
and many others. You can see a list of the available global attributes by using the query shown in Listing 28-4.
Figure 28-8 shows the partial output of this query in SQL Server 2012.
 
Search WWH ::




Custom Search