top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

When a stored procedure is compiled? On creating it or on first execution?

+2 votes
370 views
When a stored procedure is compiled? On creating it or on first execution?
posted Dec 22, 2013 by Atul Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
I think at the first execution? Not sure

1 Answer

0 votes

Procedure is compiled at the time when we execute it first time. On creation time only it's definition got stored in database. For every subsequent runs, it is for sure pre-compiled.

If you create any SP, you will find that there is no cache entry for the execution of that SP.
After running the SP for the first time, the entry for the cache is made in the system.

answer Dec 24, 2013 by Neeraj Pandey
...