• Based on this excerpt from MSDN the SP_Recompile will just clear the plan cache for the associated object.

    The sp_recompile system stored procedure forces a recompile of a stored procedure the next time that it is run. It does this by deleting the existing plan from the procedure cache forcing a new plan to be created the next time that the procedure is run.

    (From https://msdn.microsoft.com/en-us/library/ms190439(v=sql.110).aspx)

    This means you've essentially developed a script that replicates what DBCC FREEPROCACHE does.