Tech Blog

Clear MSSQL Query Caches

Posted At : February 3, 2009 11:12 AM

Found this useful little snippet for when you are load testing MSSQL Servers.

You can use it to clear the query cache - to ensure you are starting from a level playing field. Or if you are tuning queries in a application and want to ensure they are not cached run it before each run:

dbcc freeproccache
go
dbcc dropcleanbuffers
go

Cheers, Mark