devxlogo

SQL Server 7.0 Allows Creation of a Procedure that References a Nonextant Table

SQL Server 7.0 Allows Creation of a Procedure that References a Nonextant Table

SQL Server 7.0 uses deferred name resolution in stored procedures, triggers, and statement batches. It allows the creation of stored procedures that reference objects that do not yet exist. During compilation, all objects referenced in the stored procedure are resolved. At creation time, only syntax checking is done. The text of the stored procedure is stored in the syscomments system table. When a stored procedure is executed for the first time, the query processor reads the text of the stored procedure from the syscomments system table of the procedure and checks that the names of the objects used by the procedure are present. The stored procedure is then compiled to generate an execution plan when it is executed, if a valid plan does not already exist in the cache.

Thus, a syntactically correct stored procedure that references objects, which do not exist, can be created successfully. However, they will fail at execution time because referenced objects do not exist.

See also  5 Benefits of Using Time Tracking Software
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist