You are here:About>Computing & Technology>Databases> SQL Server> Creating Traces with SQL Server Profiler
About.comDatabases
SQL Server Profiler Trace
SQL Server Profiler Trace
Mike Chapple
Newsletters & RSSEmail to a friendSubmit to Digg

How To Create a Trace with SQL Server Profiler

From Mike Chapple,
Your Guide to Databases.
FREE Newsletter. Sign Up Now!
Traces allow you to track the specific actions performed against a SQL Server databases. They provide valuable information for troubleshooting database issues and tuning database engine performance. In this tutorial, we walk through the process of creating a SQL Server Trace with SQL Server Profiler, step-by-step.
Difficulty: Average
Time Required: 15 minutes

Here's How:

  1. Open SQL Server Management Studio by selecting it from the Start menu.
  2. From the Tools menu, choose SQL Server Profiler.
  3. When SQL Server Profiler opens, select New Trace from the File menu.
  4. SQL Server Profiler will then prompt you to connect to the SQL Server instance you wish to profile. Provide the connection details and click the Connect button to continue.
  5. Create a descriptive name for your trace and type it into the "Trace Name" textbox.
  6. Select a template for your trace from the drop-down menu. (See the Tips below for information on some commonly used trace templates)
  7. Select Save to File to save your trace to a file on the local hard drive. Provide a file name and location in the Save As window that pops up as a result of clicking the checkbox.
  8. Click on the Events Selection tab to review the events you may monitor with your trace. Some events will automatically be selected based upon the template you chose. You may modify those default selections at this time. You may view additional options by clicking the Show All Events and Show All Columns checkboxes.
  9. Click the Run button to begin your trace. SQL Server will begin creating the trace, providing details as shown in the image. (You may click on the image to enlarge it.) When you are finished, select Stop Trace from the File menu.

Tips:

  1. The Standard template collects a variety of information about SQL Server connections, stored procedures and Transact-SQL statements.
  2. The Tuning template collects information that may be used with the Database Engine Tuning Advisor to tune your SQL Server's performance.
  3. The TSQL_Replay template gathers enough information about each Transact-SQL statement to recreate the activity in the future.

What You Need:

  • SQL Server Management Studio
 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.