|
|
|
|
|
|
|
|
|
Using WITH RECOMPILE With a Stored Procedure - Part 1
WITH RECOMPILE is a way to tell SQL to build a plan, execute it, and then throw it away. Why do that? Usually it's because the underlying data is distributed in a way that a one sized fits all plan just doesn't really fit all. WITH RECOMPILE applies to all the statements in the procedure, so if you only have one statement, it's not bad, but if you have multiple statements, check out OPTION RECOMPILE which does the same thing at the statement level.
|
|
|
|
Duration:
|
1
mins
56
secs
|
|
Skill Level:
|
100
|
|
Rating:
|
4.29
out of 5
|
|
Publish Date:
|
August 17, 2010
|
|
|
|
About the Author
|
|
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.
|
|
References
|
|
Comments
|
|
good
|
|
Marc Moshman on
8/18/2010
Interesting, not just for the 'with recompile' information, but the info on managing/mining the procedure cache
|
|
Kasey Wheeler on
8/18/2010
Good video, nice and short. Keep em comin'!!!
|
|
|
Very nice
|
|
|
You fly by what you're doing so fast, I don't have time to see what you're executing. What's the rush? Give us a few seconds to see what you're doing.
|
|
|
Thanks, Andy, for your continued, great presentations.
|
|
|
good info
|
|
|
I'm not sure why I would need to do this yet, but I'll keep watching. It looks interesting.
|
|
Santosh Singh on
8/30/2010
didnt know that you could specify with recompile while creating the stored procedures
|
Must Be Logged In
|
|
|
|
|