Different types of Stored Procedure in sql server.

By Purushottam Rathore Jul 12, 2010
Different types of Stored Procedure in sql server.

Temporary Stored Procedures - SQL Server supports two types of temporary procedures:
  • Local temporary procedure
  • Global temporary procedure
Local temporary:
  • A local temporary procedure is visible only to the connection that created it.
  • Local temporary procedures are automatically dropped at the end of the current session.
Global temporary:
  • A global temporary procedure is available to all connections.
  • Global temporary procedures are dropped at the end of the last session using the procedure. Usually, this is when the session that created the procedure ends.
Temporary procedures named with # and ## can be created by any user.

System stored procedures are created and stored in the master database and have the sp_ prefix.(or xp_) System stored procedures can be executed from any database without having to qualify the stored procedure name fully using the database name master.

Automatically Executing Stored Procedures - One or more stored procedures can execute automatically when SQL Server starts. The stored procedures must be created by the system administrator and executed under the sysadmin fixed server role as a background process.
The procedure(s) cannot have any input parameters.

User stored procedure
Purushottam Rathore

I am working as a Software Developer and has 6 years of experience on Microsoft Technology and having a Master Degree in Computer Application. I really like to work in the .NET platform. and working with ASP.NET 2.0/3.5/... Read more

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs