Nov 13 2019

Come rinnovare un Piano Esecuzione di una stored procedure in SqlServer

Category: TecnologiaAntonio @ 23:40


DECLARE @PlanHandle VARBINARY(64);

SELECT @PlanHandle = deps.plan_handle
FROM sys.dm_exec_procedure_stats AS deps
WHERE deps.object_id = OBJECT_ID(‘__NOME__STORED__’) AND deps.database_id = DB_ID();

select @PlanHandle

IF @PlanHandle IS NOT NULL
BEGIN
DBCC FREEPROCCACHE(@PlanHandle);
END
GO

EXEC sp_recompile N’__NOME__STORED__’;

Rispondi