How stored procedures are saved?

We know that stored procedures are special database objects which are stored in database and can be invoked or executed as and when needed.
But, where these stored procedures are stored in database? And how are the stored procedures stored?

In this article we will discuss in detail about how and where stored procedures are saved.

When stored procedures are compiled, these stored procedures are saved in the following 3 system tables:

Sysdepends: This table will contain all the database objects which are referred or used in stored procedure like tables,columns,functions,Stored procedures, etc.,

Number of records inserted in this table for each stored procedure depends on number of dependent objects in that stored procedure.

Sysobjects : When ever any database object is created in the database an entry will be made in this table. Since Stored procedure is also a database object, this table will have an entry for this as well.

Syscomments : Text column in this table will hold the complete structure of stored procedure. That is text column in this table will contain the SQL statements which are used for creating stored procedure.



This entry was posted in . Bookmark the permalink.

Leave a reply