THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Kalen Delaney

Geek City: Clearing a Single Plan From Cache in SQL Server 2008

 

I just today found out about something that was in plain sight in the Books Online... but the documentation is so vast, I haven't discovered everything yet.

I blogged about clearing a single plan from cache in SQL Server 2005 a while back, and mentioned a rumor that there would be a new way to do this in SQL Server 2008. And then just today, someone posted a comment on that blog post, asking about the new 2008 method.

One of my contacts on the SQL Server team at Microsoft just sent me an email telling me about new features related to plan caching, as I am starting to work on updating that chapter for my 2008 book. He mentioned that DBCC now takes parameters, and one of the parameters is a plan handle!

DBCC FREEPROCCACHE [ ( { plan_handle | sql_handle | pool_name } ) ] [ WITH NO_INFOMSGS ]

There is full example in the Books Online, so I won't repeat it here. If you don't have a local copy of BOL handy, you can read about the new option to DBCC FREEPROCCACHE online here:

http://msdn.microsoft.com/en-us/library/ms174283.aspx

 

Have fun!

~Kalen

Published Friday, October 31, 2008 5:43 PM by Kalen Delaney

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Michael Swart said:

Awesome, I found this functionality useful to work around a bug documented on MS's connect site.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=378127

November 3, 2008 12:25 PM
 

Kalen Delaney said:

I know Friday afternoon isn't the best time for blogging, as everyone is going home now, and by Monday

May 21, 2010 8:46 PM
 

Kalen Delaney said:

I know Friday afternoon isn't the best time for blogging, as everyone is going home now, and by Monday

May 21, 2010 8:47 PM
 

Steven Devaney said:

Thank you so much!

September 17, 2010 9:27 AM
 

DBCC Cleaning CACHE ??? Memory | 123 said:

July 25, 2014 12:10 AM

Leave a Comment

(required) 
(required) 
Submit

This Blog

Syndication

Favorite Non-technical Sites or Blogs

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement