Question

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.

Was it helpful?

Solution

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>'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top