Home > Ask the SQL Server Experts > Denny Cherry - Performance Tuning Questions & Answers > Use SQL Profiler to find long running stored procedures and commands
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Use SQL Profiler to find long running stored procedures and commands

Denny Cherry EXPERT RESPONSE FROM: Denny Cherry

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Expert advice on database development
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 11 March 2008
I am a performance testing engineer and new to performance tuning. In SQL Server Profiler, I have noticed one of our stored procedures is running many times and taking long durations of time. I want to know why this stored procedure run time is so long. Can you please provide the steps I should follow to fix this issue?

>
EXPERT RESPONSE
To see why a stored procedure is running too many times you will need to review the application code that calls the stored procedure.

As to the long running procedure, you can bring up SQL Server Profiler again and add in the event "SP:StatementStarting" and "SP:StatementCompleted." This will show you each command within the stored procedure and how long each command takes. You can then find the command with the high run time and tune that specific query. Normally, this will be caused by incorrect indexing on one or more tables used by the query.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
SQL Server stored procedures
SQL Server trigger vs. stored procedure to receive data notification
How to use SQL Server 2008 hierarchyid data type
SQL and SQL Server Tutorial and Reference Guide
SQL Server stored procedures tutorial: Write, tune and get examples
Check SQL Server database and log file size with this stored procedure
SQL Server source code analysis and management adds database security
Configure SQL Server Service Broker for sending stored procedure data
Find size of SQL Server tables and other objects with stored procedure
Track changes to SQL Server 2000 and 2005 with one simple utility
Troubleshoot SQL Server 2005 temporary table performance problems

SQL Server performance and tuning
Solve SQL Server errors and more from the DBA trenches -- part 2
Tutorial: Learn SQL Server basics from A-Z
FAQ: Troubleshooting SQL Server Reporting Services
How to disable the shrink database task in SQL Server 2000 and 2005
SQL Server out of memory: Troubleshoot and avoid SQL memory problems
Basic objects of T-SQL in SQL Server 2008
Using T-SQL data types in SQL Server 2008
Additional T-SQL operations in SQL Server 2008
SQL Server 2008 function types in T-SQL
SQL Server 2008 Integration Services delivers new features

Denny Cherry - Performance Tuning
Upgrading to SQL Server 2008 advantages and hardware requirements
Tool to synchronize two SQL Server databases
SQL Server tools don't appear in menu after SQL Server 2005 install
Troubleshoot SQL Server 2005 temporary table performance problems
Maintain large SQL Server database and resolve website 'Timeout Error'
How to retrieve SQL Server database disk space in use
Performance tuning for SQL Server 2005 and Exchange running on SBS
Upgrade databases to SQL Server 2005 after server upgrade
Upgrade to SQL Server 2005 or SQL Server 2008?
Merge replication to keep SQL Server databases in sync

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
library  (SearchSQLServer.com)
trigger  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SQL Solutions - SQL Database Design
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2005 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts