O'Reilly logo

Microsoft SQL Server 2012 Bible by Aaron Nelson, Jose Chinchilla, Patrick LeBlanc, Jorge Segarra, Adam Jorgensen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running Profiler

SQL Server Profiler can be opened from several locations:

  • From the Start menu, Profiler is under the SQL Server 2012 → Performance Tools menu.
  • In Management Studio, Profiler is in the Tools menu.
  • Within Management Studio's Query Editor, the context menu includes the option to Trace Query in SQL Server Profiler. This option opens Profiler filtered to the current connection.

Defining a New Trace

When a new trace is created (with the New Trace toolbar button or File → New Trace), a connection is created to a SQL Server, and the Trace Properties dialog (see Figure 38.1) displays. The Trace Properties General tab sets up the trace (name, file destination, and so on), and the Events Selection tab defines the events and data columns to be recorded, as well as the filter. If the trace is running, the properties may be viewed but not changed. You can save a trace configuration as a template to make creating new traces easier.

Figure 38.1 This SQL Server Profiler uses the T-SQL Duration template and can write information to a file.

38.1

A Profiler trace is primarily viewed interactively (because otherwise you should be running a scripted server-side trace), but the data can also be written to a file or a SQL Server table. This is useful for further manual analysis, viewing alongside System Monitor counter data, or importing into the Database Engine Tuning Advisor.

When Profiler ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required