How can I clear the SQL Server query cache?

I’ve got a simple query running against SQL Server 2005

SELECT * 
FROM Table 
WHERE Col="someval"

The first time I execute the query can take > 15 secs. Subsequent executes are back in < 1 sec.

How can I get SQL Server 2005 not to use any cached results? I’ve tried running

DBCC DROPCLEANBUFFERS
DBCC FREEPROCCACHE

But this seems to have no effect on the query speed (still < 1 sec).

5 Answers
5

Leave a Comment