Databases Reference
In-Depth Information
FIGURE 13-17
With the session running, you can then execute the insert statement from the previous example to
cause locks to be acquired in your sample database:
insert t1 (val1, val2) (select val1, val2 from t1)
This produces data in the histogram that looks something like what is
shown in Figure 13-18.
If you are wondering what the object IDs refer to in the example database,
245575913 was the actual table t1 , while 261575970 was the default con-
straint that was bound to the ID column of table t1 .
FIGURE 13-18
Creating Sessions Using T-SQL
It has been mentioned throughout this chapter that Extended Events has a very comprehensive set
of T-SQL commands, which have deliberately not been covered in depth here. Unfortunately, their
complexity has been one of the main reasons why people have not yet begun to use them, which is
why this material has focused on using the SSMS interface.
However, if you want to start using the
T-SQL Extended Events commands, the SSMS
interface can help you get started by scripting
out a session after you dei ne it. You can do
this using the Script button, which you are
probably familiar with from other parts of
SSMS; however, it's shown in Figure 13-19.
FIGURE 13-19
 
Search WWH ::




Custom Search