Creation of procs,udfs and views

Creation of procs,udfs and views
While creating stored procedures and functions,the parser only checks for syntax and once the syntax has been cleared by the parser, the proc is created.This does not necessarily mean, the procedure is going to work. The reason is that parser does not check if all the referred objects are correct.For example,if the columns and\or tables mentioned inside procedure might not exists but still, if T-sql syntax is correct, creation of the procedure will succeed.

Obviously, while executing the procedure, it will try to generate an execution plan and that’s where it figures out *mistake* and throws out an error. The same thing applies for user defined functions.

But, it is different in Views, if you mistype a column or table name, the creation of the View fails. I think the reason for this,even though the view does not hold any data, it materializes the definition of view. So, this step requires both validating the syntax and table references.