Surendra Sharma

Surendra Sharma

Search This Blog

Tuesday, April 8, 2014

How to use SQL Server Profiler in easy steps

Most of the .NET developers have to deal with SQL server. Some may be good in database while most of the developers are great in front end but know only the basic knowledge of SQL Server database.

During development, these developers have to face the database performance issues. For most of the developers this database query performance kind of tasks are bouncers. 

Here I am trying to explain how you can use SQL Server profiler for identifying query performance.

Suppose I have to check performance of below queries

SELECT * FROM TableA
GO
SELECT * FROM TableB
GO
SELECT * FROM TableC
GO

1.    First open SQL Server Profiler from Tools -> SQL Server Profiler







2.    Login to SQL Server Profiler and click on Events Selection tab of Trace Properties window.

 

3.    Uncheck all events in Events Selection tab except SQL:BatchCompleted. Select Show All Columns radiobutton and click on Column Filters… button.

 

4.    Select HostName filter from Edit Filter screen and click on Like option. Enter here filter value as ‘%ComputerName%’. Click Ok.

 

5.    Click Run.
6.    Now run queries in SQL Server.
7.    Check status of all queries in SQL Server profiler as below

 

8.    The most important data are CPU, Reads, Writes and Duration. Here higher figures of these columns show the action required for query optimization.


Please leave your comments or share this article if it’s useful for you.

No comments:

Post a Comment