I often heard people saying that stored procedures are pre-compiled. What does it mean?
Actually we write the queries into the stored proc and then compile it. If any syntactic error is there, it complains. So if that is the case then the compilation is happening at that point of time.
Then, what does “Pre” refer to?
They are actually pre-parsed and syntax/semantics checked on CREATE and ALTER
“Compilation” to a query plan happens on demand
For an overview of compilation and re-use, see “Batch Compilation, Recompilation, and Plan Caching Issues in SQL Server 2005 “
The terminology (in what you mean) goes back to SQL Server 6.5. The “new” way highlighted in the previous white paper link started with SQL Server 7.0