How SQL Server Processes Stored Procedures

When you first execute a stored procedure, the SQL Server query processor reads the code of the stored procedure from the syscomments table and begins the deferred name resolution process.

Deferred Name Resolution

Deferred name resolution is the process of checking the names of all objects that a stored procedure uses to make sure that they exist. Tables, stored procedures, or other objects referenced by the stored procedure don't have to exist when the procedure is first created. SQL Server doesn't resolve the names of the objects until the stored procedure is actually executed. The resolution process occurs whenever a stored procedure needs to be compiled, such as when the server is first restarted ...

Get Writing Stored Procedures for Microsoft SQL Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.