Does executing a ALTER PROCEDURE
statement for a stored procedure cause all cached execution plans for that stored procedure to become invalid and expire in SQL Server 2008 / 2005?
Yes.
You can verify this by doing
SELECT * FROM sys.dm_exec_procedure_stats
where object_id = object_id('YourProc', 'P')
before and after.
From TechNet
[situations in which plans would be removed from cache include] global operations like running
DBCC FREEPROCCACHE
to clear all plans from cache, as well as changes to a single procedure, such asALTER PROCEDURE
, which would drop all plans for that procedure from cache.