Using deferred_name_resolution

When this feature is active (using set option deferred_name_resolution, or made globally active by using the configuration parameter deferred name resolution), the objects inside the procedures are resolved at execution time, instead of at creation time. This option allows you to create procedures that reference objects that did not exist when the procedure was created.

For example, using deferred_name_resolution allows creating a procedure that references a non-existing table. This example shows an attempt to create a procedure without deferred_name_resolution:

select * from non_existing_table
-----------
error message
Msg 208, Level 16, State 1:
Line 1:
non_existing_table not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).

However, using this option allows you to create the procedure without raising an error because of the missing objects.

set deferred_resolution_on
-----------------
create proc p as select * from non_existing_table
-----------------

Note deferred_name_resolution does not resolve user-defined datatypes at execution. They are resolved at creation time, so if the resolution fails the procedure cannot be created.

Resolving objects at creation time means that object resolution errors are also raised at execution, not creation.