Solved

stored procedures execution plan

Posted on 2012-03-14
4
304 Views
Last Modified: 2012-03-14
How can I find out if my stored procedures execution plan is being recompiled each time it runs.

When I run the same query when it is not encapsulated inside a procedure it is much faster.
0
Comment
Question by:Mr_Shaw
  • 2
4 Comments
 
LVL 3

Assisted Solution

by:GiantSlayer
GiantSlayer earned 50 total points
ID: 37719586
If your parameter values in your sp vary a lot, SQL doesn’t benefit from the cached execution plan.

You could use WITH RECOMPILE to force recompilation each time the sp is run, or if the sp is large, try and split it up into multiple smaller sp’s.

A bit about recompiling sp's:
http://msdn.microsoft.com/en-us/library/ms190439.aspx
0
 

Author Comment

by:Mr_Shaw
ID: 37719736
I don'y want to recompile... i want to see if the sql engine is recompliling the sproc automatically.
0
 
LVL 25

Accepted Solution

by:
jogos earned 450 total points
ID: 37720065
0
 

Author Closing Comment

by:Mr_Shaw
ID: 37720973
thanks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Query 2 43
email the result out from a T-SQL queries 29 62
INSERT DATE FROM STRING COLUMN 18 49
triggered use of sp_send_dbmail failure 2 22
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now