Causes each stored procedure and trigger that uses the specified table to be recompiled the next time the stored procedure and triggers are run.
sp_recompile tabname
where
The queries used by stored procedures and triggers are optimized only once, when they are compiled. As you add indexes or make other changes to your database that affect its statistics, your compiled stored procedures and triggers may lose efficiency. By recompiling the stored procedures and triggers that act on a table, you can reoptimize the queries for greatest efficiency.
The sp_recompile system procedure looks for a table in the current database only. It cannot be used on system tables.
This example causes each trigger and stored procedure that uses the titles table to be recompiled the next time it is run.
sp_recompile titles
Execute permission defaults to the public group.
sysobjects