Getting Started with SQL Profiler

Created by Uma Mahesh.G

Getting Started with SQL Profiler SQL Profiler: SQL Profiler is one of the standard suite of client tools that are distributed with SQL Server 2000 and 2005. They are a part of the main SQL Server setup, but you don't have to install SQL Server to install the client tools. Accessing SQL Profiler: You can launch SQL Profiler by selecting Start >>Programs>>Microsoft SQL Server>>Profiler Creating a Trace: 1. Click the New Trace toolbar button or select New Trace from the File menu. This will prompt you to connect to a SQL Server. 2. Authenticate with username and password\

3. To set up a new trace, you need to fill out the four tabs of this dialog box. You can accept all
of the defaults and still get a reasonable trace for most purposes.

-1-

Getting Started with SQL Profiler

Created by Uma Mahesh.G

4. Go to Events selection and There are a number of events that you can audit here; don't select them all unless you want, The default set is a good starting point when you want to know what's going on with SQL statements sent to your database. 5. Select “Show all events” to show all event options, If you want to know more information on stored procedures, Select RPC: Starting, RPC: Completed, SP:Completed and SP:Starting

6. To start tracing, click the Run button in the New Trace dialog box. There are also buttons on
the SQL Profiler toolbar to start, stop, and pause traces.

-2-

Getting Started with SQL Profiler

Created by Uma Mahesh.G

7. After starting the trace, fire a sample application, that will loaded the data, save the change,
close the application, and stop the trace.

For particular application event, SQL profiler shows the executed transaction statements. Go to RPC: starting and completed transactions for executed stored procedure Ex: - Stored procedures: select exec fsAccount_getIPPool 2 exec fsAccount_GetAccess 2,2

You can compare your UI events with the traced stored procedures results and you can debug strored procedures. All in all, SQL Profiler is a great tool for peering under the hood of your SQL Server installation. Try once it and you're sure to save debugging time in the future.

-3-

Sign up to vote on this title
UsefulNot useful