Bagikan melalui


Stored Procedures (Visual Database Tools)

Stored procedures can make managing your database and displaying information about that database much easier. Stored procedures are a precompiled collection of SQL statements and optional control-of-flow statements stored under a name and processed as a unit. Stored procedures are stored within a database, can be executed with one call from an application, and allow user-declared variables, conditional execution, and other powerful programming features.

Stored procedures can contain program flow, logic, and queries against the database. They can accept parameters, output parameters, return single or multiple result sets, and return values.

You can use stored procedures for any purpose for which you would use SQL statements, with these advantages:

  • You can execute a series of SQL statements in a single stored procedure.

  • You can reference other stored procedures from within your stored procedure, which can simplify a series of complex statements.

  • The stored procedure is compiled on the server when it is created, so it executes faster than individual SQL statements.

The functionality of a stored procedure is dependent on the features offered by your database. For more details about what a stored procedure can accomplish for you, see your database documentation.

See Also

Reference

Stored Procedure Properties

Other Resources

Working with Stored Procedures and User-Defined Functions