Deferred Name Resolution

In SQL Server 2008, the object names that a stored procedure references do not have to exist at the time the procedure is created. SQL Server 2008 checks for the existence of database objects at the time the stored procedure is executed and returns an error message at runtime if the referenced object doesn’t exist. The only exception is when a stored procedure references another stored procedure that doesn’t exist. In that case, a warning message is issued, but the stored procedure is still created (see Listing 28.6).

Listing 28.6 Procedure Name Resolution During Stored Procedure Creation

image

When a table or view does exist ...

Get Microsoft® SQL Server 2008 R2 Unleashed 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.