標籤:roc cache https log tar creat div nbsp DApp
參考:https://www.cnblogs.com/wy123/p/7190785.html參考:https://www.cnblogs.com/Irving/p/3951220.html
if object_id(‘tempdb..#t_remove_expired_plan‘) is not null drop table #t_remove_expired_planGOcreate table #t_remove_expired_plan( id int identity(1,1), plan_handle varbinary(500))GOinsert into #t_remove_expired_plan (plan_handle) select qs.plan_handlefrom sys.dm_exec_query_stats qs where creation_time< dateadd(hh,-24,getdate())GOdeclare @exists_data bit = 1declare @v_plan_handle varbinary(500)declare @str_sql varchar(1000)while @exists_data = 1begin select top 1 @v_plan_handle = plan_handle from #t_remove_expired_plan if(@v_plan_handle is not null) begin execute sp_executesql N‘DBCC FREEPROCCACHE(@plan_handle)‘ ,N‘@plan_handle varbinary(500)‘,@plan_handle = @v_plan_handle end delete top (1) from #t_remove_expired_plan if exists(select 1 from #t_remove_expired_plan) begin set @exists_data = 1 end else begin set @exists_data = 0 endend
參考:https://www.cnblogs.com/quanweiru/p/5577421.html
[轉][Dapper]參數化查詢慢