Solved

stored procedures execution plan

Posted on 2012-03-14
4
303 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

13 Experts available now in Live!

Get 1:1 Help Now