DBCC FLUSHPROCINDB

Leave a comment (0) Go to comments

DBCC FLUSHPROCINDB command is used to clears all plans for a single database.

For example, the following code, will clear all the plans for pubs database and force to recompile all stored procedures on first execution.

 

 

----Determine the id of the pubs database

DECLARE @intDBID INTEGER


SET @intDBID = (SELECT dbid

                FROM master.dbo.sysdatabases

                WHERE name = 'pubs')

 

----Recompile the stored procedures

DBCC FLUSHPROCINDB (@intDBID)

 

Note : This, DBCC FLUSHPROCINDB command is undocumented and unsupported by Microsoft.

EOF - DBCC FLUSHPROCINDB, SQL Server 2012 , 2008 R2 , 2008 , 2005 , 2000

Leave a Reply

Your email address will not be published. Required fields are marked *


*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.