DBCC FreeSessionCache

Download PDF

Being day 13 of the DBCC Command month at SteveStedman.com, today’s featured DBCC Command is DBCC FREESESSIONCACHE.


DBCC FreeSessionCache is only available on SQL Server 2005 and newer it removes all queries from the distributed query cache. This however does not impact anything in the standard procedure cache, to clear the standard procedure cache use DBCC FreeProcCache instead. The distributed query cache contains the queries that used the OPENROWSET and OPENDATASOURCE functions to connect to remote data sources.  There is not output generated other than the standard completed message.

DBCC FreeSessionCache Syntax:

DBCC FreeSessionCache


The following example clears all distributed queries from the distributed query cache.

DBCC FreeSessionCache

Which produces the following output.



One of the less common DBCC commands, keep in mind if you really want to clear the procedure cache use DBCC FreeProcCache instead.

For more information see TSQL Wiki DBCC freesessioncache.

DBCC Command month at SteveStedman.com is almost as much fun as sitting in the waiting room at the dentist.



Tagged with: , , ,

Leave a Reply

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


Time limit is exhausted. Please reload CAPTCHA.