Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Jun 24, 2005

Working with the SQL Profiler

By Steven Warren

In SQL Server 2000, the SQL Profiler can help you diagnose and fix SQL Server performance issues. This tool lets you trace events and play back the results, which can help you determine application and/or query problems, such as long-running queries or ineffective indexes. Let's take a look at how you can use the SQL Profiler to monitor, analyze, and tune your SQL server.

When you open SQL Profiler (Figure A), you can run traces on a set of criteria you specify.

These criteria or events can be one or more of the following:

  • Cursors
  • Database
  • Errors and Warnings
  • Locks
  • Objects
  • Performance
  • Scans
  • Security Audit
  • Server
  • Stored Procedures
  • Transactions
  • TSQL

SQL Profiler includes a set of templates you can begin using right away. After becoming fluent at working with SQL Profiler, you can create your own templates or modify existing ones. Profiler offers the following eight templates shown in Table A.

Table A

Template name

Template filename


Stored Procedure Counts


This template provides a collection of events about the Stored Procedure name that has started. The results of this trace are grouped by Event Class, Server Name, Database ID, and Object ID. In addition, the Server Process ID (SPID) is trapped.



This template provides detailed information about Security Audits (Audit Login/Audit Logout), Sessions (Existing Connection), Stored Procedures, and TSQL Statements that have been completed.



This template traps TSQL Statements in the order that they occur. The results include the Event, SQL Statement, SPID, and Start Time.

TSQL Duration


This template traps the TSQL Statements, Event Class, SPID, and the time it takes in milliseconds for the TSQL Statement to execute.

TSQL Grouped


This template groups your TSQL Statements by Application Name, NT User Name, Login Name, and the Client Process ID of the application being called by SQL Server.

TSQL Replay


This template traps detailed information of the TSQL Statements that have been issued and enables you to replay the trace.

TSQL Stored Procedures


This template traps the Stored Procedures and TSQL commands associated with that Stored Procedure. This trace also traps the SPID and start time of the Stored Procedure.



This template traps TSQL Statements and SQL Batches that have completed.

MS SQL Archives

Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM