Question: The fastest way to recompile all stored procedures
I have a problem with a database running in SQL Server 6.5 (Service Pack 4 ). we moved the database (object transfer) from one machine to another last night, and an error (specific to a Stored Procedure) is cropping up. however, I can't tell which procedure is causing it. permissions are granted in all of our stored procedures; is there a way from the iSQL utility to force all stored procedures to R Ecompile?
TIPS: sp_recompile can recomplie a store procedure each time
Answer: When executing a stored procedure, use the with recompile option to force the compilation of a new plan; Use sp_recompile to force the re-compilation at the next run.
Use Adventureworks;
Go
Exec Sp_recompile n ' Sales. Customer ' ;
Go
In this way, the stored procedure associated with the table 'sales. custom' can be re-compiled at the next run.