News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Brian Swan's Blog:
Troubleshooting and Performance Tuning with SQL Server Traces
December 23, 2010 @ 12:02:41

Brian Swan has posted an example of debugging with SQL Server traces you can use in your PHP applications to help figure out what all's happening each time you run a query.

Unfortunately, SQL Profiler (a tool that allows you to easily monitor server activity) is not included as part of SQL Server Express. Fortunately, SQL Profiler is just a nice UI for functionality that is built into SQL Server (including the Express version). So, in this post I'll show you how to create, read from, and write to a trace file using SQL and SQL Server Management Studio (which you can download for free from here).

He breaks the process down into a few steps with sample code and SQL for each:

  • Create a trace (with the sp_trace_create stored procedure)
  • Set the events to be monitored
  • Filter trace data
  • Start the trace
  • Read trace data (this is where PHP comes in, code included)

With the results you can see things like read time, write time and CPU used for each part of the query making it simple to pick out the offenders.

0 comments voice your opinion now!
sqlserver performance troubleshoot tutorial traces


blog comments powered by Disqus

Similar Posts

Tom Van Herreweghe's Blog: Running Zend Framework modules from a Phar file

PHP-Coding-Practices.com: Composing Methods: Split Temporary Variable

Jani Hartikainen's Blog: What is a null object, and when are they useful?

Brian Swan's Blog: The SQL Server ODBC Driver for Linux is Available!

Bruno Goncalves' Blog: Writting your first WordPress plugin


Community Events

Don't see your event here?
Let us know!


release podcast extension example series community introduction api laravel laravel5 library interview list opinion version language php7 framework security voicesoftheelephpant

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework