I have a Stored Procedure which I want to recompile. is it safe to do that in a Live environment ? Because there's continuous flow of data which is being processed by the Stored Procedure and the SQL Server 2008.

有帮助吗?

解决方案

Depending upon the method used (i.e. do not drop and recreate the procedure using the WITH RECOMPILE option), this is perfectly safe to execute on the Live environment.

If using sp_recompile, the stored procedure will simply be flagged to cause a new query plan to be calculated the very next time it is executed. This may cause a very small delay whilst the new query plan is compiled but it will be negligible:

exec sp_recompile N'<your procedure>'
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top