Wednesday, 4 January 2012

Selectively Clearing the Plan Cache - FLUSHPROCINDB

DBCC FREEPROCCACHE clears the plan cache for the whole instance.
If you have databases from different applications / vendors on the same server however , you might need to do so for just one database. That is where DBCC FLUSHPROCINDB comes in.

1) Use DB_ID() to get the database ID for the current database.
2) Use that as a parameter for FLUSHPROCINDB 


SELECT DB_ID()

DBCC FLUSHPROCINDB(10)

No comments: