{"id":282,"date":"2015-08-09T02:56:53","date_gmt":"2015-08-09T02:56:53","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2015\/08\/09\/tsql-script-to-clear-sql-server-cache\/"},"modified":"2015-08-09T02:56:53","modified_gmt":"2015-08-09T02:56:53","slug":"tsql-script-to-clear-sql-server-cache","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2015\/08\/09\/tsql-script-to-clear-sql-server-cache\/","title":{"rendered":"TSQL Script to Clear SQL Server Cache"},"content":{"rendered":"
Below script that can be used to clear SQL Server Cache. Helpful while working on performance tuning of SQL Scripts.<\/p>\n
Note<\/strong> that this script is solely for running on Development environments, do not run in Production as it would cause issues to queries that depend on cached data. <\/p>\n","protected":false},"excerpt":{"rendered":" Below script that can be used to clear SQL Server Cache. Helpful while working on performance tuning of SQL Scripts. CHECKPOINT; GO DBCC DROPCLEANBUFFERS DBCC FREEPROCCACHE DBCC FREESYSTEMCACHE (‘ALL’) DBCC FREESESSIONCACHE GO Note that this script is solely for running on Development environments, do not run in Production as it would cause issues to queries…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2172,1789],"tags":[],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-performance-tuning","category-t-sql-code-examples"],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/comments?post=282"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/282\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\nCHECKPOINT;
\nGO
\nDBCC DROPCLEANBUFFERS
\nDBCC FREEPROCCACHE
\nDBCC FREESYSTEMCACHE ('ALL')
\nDBCC FREESESSIONCACHE
\nGO
\n<\/code><\/p>\n