What are the checks performed by the SQL Server while compiling stored procedures?

SQL Server will parse the queries that are present in stored procedure and checks for the following:
  • Check whether all the queries are syntactically correct or not.
  • Check whether all the tables listed in stored procedures exists in database or not. If some tables are internally created as part of stored procedure, then temporary tables will be created fro time being and these tables will be used while compiling the query. These tables are not permanent. They will not be present in the database after stored procedure compilation. This type of compilation is known as Deferred Name Resolution.
  • Check whether all the columns which are used in stored procedure exists in data base in appropriate tables.

This entry was posted in . Bookmark the permalink.

Leave a reply