Resources » Software & Programming » MS SQL Server

How to use SQL Server Profiler


Posted Date:     Category: MS SQL Server    
Author: Member Level: Diamond    Points: 75


Like to learn how to use SQL Server Profiler to troubleshoot your database operations? Learn the basics of SQL Server profiler and how to use it.

SQL Server Profiler allows you to trace the database queries that you run against your database. This is very helpful when you are trying to troubleshoot your code which is not really doing what is expected on the database.

Consider this scenario. You are developing an Applications and you expect some data to be saved in the database when some event happens Or, you may be using an application which read data from some excelfile and save into database but you don't see the data saved in to the database. Somewhere the operation fails without giving an error and now you like to know if the data is really sent to database or not.

SQL Server Profiler helps you trace the sql statements executed against the database and helps you find what sql statements are really executed against the database from your code.



How to launch SQL Server Profiler


You can launch the SQL Server profiler from your Programs Menu if you have the complete SQL Server client tools installed.

Open your Programs menu from Windows Start screen. Select SQL Server and then expend "Performance Tools". You will see SQL Server Profiler listed there. Select it to launch the profiler.

SQL Server Profiler

If you have SQL Server Management Studio open, you can launch the profiler directly from there. Click on the Tools menu and then select "SQL Server Profiler".

How to use SQL Server Profiler


Once you have launched the profiler, you can start a session. Click on "File" and then "New Trace" in the menu. This will start a new tracing session.

You will be prompted to connect to your SQL Server instance to run the profiler against. Choose the right connection settings so that you can run the profiler against the database.

Connect to database

After you connect to the database, you will be prompted to select the trace properties. You may leave all options to the default values. Make sure the template "Standard" is selected in the field for "templates".

Run SQL Profiler

Click on "Run" to start the session in the profiler.

You will see a new window opened which will show all SQL statements executed against the database to which you are connected.

SQL Profiler Running

If you are debugging some code and trying to figure out what values are sent to the database, try do it now. Run your applications or debug it step by step. After each step of the database operation, come back to the SQL Profiler and see the database statements executed by code.



Hope this article was helpful to debug your database operations.





Did you like this resource? Share it with your friends and show your love!





Responses to "How to use SQL Server Profiler"
Guest Author: christi parks     03 Dec 2012
Hello, i would like to ask that what is the benefits of sql training, what all topics should be covered and it is kinda bothering me … and has anyone studies from this course http://www.wiziq.com/course/125-comprehensive-introduction-to-sql of SQL tutorial online?? or tell me any other guidance...
would really appreciate help… and Also i would like to thank for all the information you are providing on sql training.



Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Connection of Java Programming with SQL
    Return to Resources
    Post New Resource
    Category: MS SQL Server


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    (No tags found.)

    Subscribe to our upcoming monthly newsletters and learn about the new opportunities in Techulator.com

    Sign up for our Newsletter!
    Subscribe to RSS Feeds by Email

    Online Members

    patrick
    More...
    Awards & Gifts
    Active Members
    TodayLast 7 Daysmore...

    Talk to Webmaster Tony John