[Company Logo Image] 

Home Up Contents Coffee Break Credits Glossary Links Search

 
System Stored Procedure sp_recompile

 

 

Home
Analysis Services
Azure
CLR Integration
High Availability
Open Source
Security
SQL Server 2008
SQL Server 2012
SQL Server 2014
SQL Server 2016
SQL Server 2017
SQL Server 2019
Tips
Troubleshooting
Tuning

System Stored Procedure sp_recompile

 

/*
 

System Stored Procedure sp_recompile
By: Alberto Morillo - www.sqlcoffee.com

Whenever you add new indexes to a table or modify its structure extensively is a good practice to recompile all stored procedures involved with that table, so the queries included on those stored procedures could be reoptimized.

The following example is using the Employees table of AdventureWorks database.


*/
USE AdventureWorks;
GO
EXEC sp_recompile N'HumanResources.Employee';
GO

/*

Resulting message for this instruction should be:
Object 'HumanResources.Employee' was successfully marked for recompilation.
*/




 

 

.Send mail to webmaster@sqlcoffee.com with questions or comments about this web site.