How to let SQL Server know not to use Cache in Queries?

后端 未结 3 1249
挽巷
挽巷 2020-12-29 23:35

Just a general question:

Is there a query/command I can pass to SQL Server not to use cache when executing a particularly query?

I am looking for a query/com

3条回答
  •  醉酒成梦
    2020-12-30 00:10

    DBCC FREEPROCCACHE
    

    Will remove all cached procedures execution plans. This would cause all subsequent procedure calls to be recompiled.

    Adding WITH RECOMPILE to a procedure definition would cause the procedure to be recompiled every time it was called.

    I do not believe that (in SQL 2005 or earlier) there is any way to clear the procedrue cache of a single procedures execution plan, and I'd doubt you could do it in 2008 either.

提交回复
热议问题