Login or Sign Up to become a member!

EXPERTS, INFORMATION, IDEAS & KNOWLEDGE

Social bookmarker Add this

Your profile

Search

July 2009
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

XML Feeds

Authors

« SQL Server Case/When Data Type problemsIndex and Statistic creation with SQL Server DTA »
The Data Management Journal

sqltrace: A Tool Every SQL Server Developer Should Have

by SQLDenis


Permalink 03 Dec 2008 08:08 , Categories: Data Modelling & Design Tags: performance tuning, sql server 2005, sql server 2008, tool, trace, tuning

sqtlrace is a stored procedure written by Lee Tudor (a.k.a Mr Tea.) The procedure takes an SQL batch as its first argument, sets up a trace filtered to include the current connection only, runs the batch, and summarises the trace information per statement in the batch. This can be a very handy tool to track down performance bottlenecks in a longer stored procedure, not the least if there are calls to nested procedures.

You can also use sqltrace to capture the query plans from a batch. This makes it possible to capture a single plan in a deep chain of nested stored procedures without drowning in all the other plans. This is particularly convenient with SSMS 2008: if you click on the XML document for the plan in grid mode, the graphical plans open directly.

Erland Sommarskog is hosting this on his site, you can get the source code and more info here: http://www.sommarskog.se/sqlutil/sqltrace.html

Leave a comment »Send a trackback » 909 views

Trackback address for this post

Trackback URL (right click and copy shortcut/link location)

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)