Friday, May 15, 2009

Recompile Stored Procedures In SQL Server

After heavy insertion and updation of many rows in one table then the stored procedure on that table execution degrades the performance. I prefer to recompile all the stored procedure on the table, which has faced heavy insert or update.

1.) Following script will re-compile all the stored procedure on a particular table Person.Address in AdventureWorks database. 
USE AdventureWorks;
GO
EXEC sp_recompile N'Person.Address';
GO 


2.) Following script will recompile specific stored procedure uspGetEmployeeManagers only in AdventureWorks database. 
USE AdventureWorks;
GO
EXEC sp_recompile 'uspGetEmployeeManagers';
Go



Tags: sql server recompile. recompile stored procedures. recompile sp's. stored procedure recompile. recompile specific stored procedure. data insert in sql server. data update in sql server. huze insertion. huze updation of data. sql table insertion. sql table insertion. SQL developer. sql development. sql developing. sql script. sql query. sql stored procedure. re-compile, recompile.

0 comments:

Post a Comment