Databases Reference
In-Depth Information
CROSS JOIN sys.columns AS C2
CROSS JOIN sys.columns AS C3
GO
12. After executing the previous script, switch to SQL Server Profiler and stop the trace.
Notice the CPU, Duration, StartTime, EndTime, Reads, and Write columns. The
following screenshot shows the trace after execution of the script:
Notice in the figure, how some of the SQL:BatchCompleted events caused high number of
CPU usage counts, duration counts, and reads/writes counts. These queries are resource
consuming and thus expensive queries.
How it works...
We started a new trace in SQL Server Profiler. We selected Blank trace template and
SQL:BatchCompleted event class that is the only event we wanted to capture. We then
specified a trace filter on DatabaseName data column so that only the events which are
occurred against AdventureWorks2012 database are captured.
We organized data columns in the Organize Columns dialog box so we can have a better view
of data columns that we are interested in when trace data is displayed in SQL Server Profiler;
we do not have to scroll much across the right side to see the values of TextData, CPU,
Duration, StartTime, Endtime, Reads, and Writes data columns.
 
Search WWH ::




Custom Search