Dropping SQL Server Cache

If you are anything like me, you want to know if your updates to your database have improved on a 0-60 basis or not.

Unfortunately, if you run the same query back-to-back, then you will often run into SQL Server caching the query and optimizing your results.

The following will clean out the cache for your testing and analysis purposes.

USE {DATABASE};
GO
CHECKPOINT;
GO
DBCC DROPCLEANBUFFERS;
GO

RJ writes custom Windows and Web applications using the Microsoft .NET framework, and enjoys solving problems with code, often while listening to a techno soundcloud stream. He hopes to one day write an application that many businesses will use.

Twitter 

Leave a Reply

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