In
this article I am going to explain how to clean cache and buffer for sql server store procedure.
In
previous article I have explained Sql server STUFF function, Sql server CONCATfunction, Sql server CHAR function and Sql server ASCII function.
Description:
We
need to clear the cache and buffer to measure the exact time duration of
execution. You can clear the cache by restarting the sql server or by command execution.
Sql server provides 2 DBCC commands.
DBCC
FREEPROCCACHE is used to clear procedure cache. It will clear all query’s plan
and recompiled all statements.
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS is used to clear all buffers from buffer pool without shutting down and restarting the server. Use checkpoint this command.
CHECKPOINT;
GO
DBCC DROPCLEANBUFFERS;
GO
0 Comments