Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Intermediate
Sep 20, 1999

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.

Jai Bardhan
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap