What Is a Stored Procedure?

A stored procedure is a series of precompiled SQL statements and control-of-flow language statements. Stored procedures can enhance standard SQL by enabling you to use parameters, make decisions, declare variables, and return information. You can think of a stored procedure as a program or function that is stored as a database object on SQL Server. When a stored procedure is executed, the stored procedure runs on SQL Server—not on the client issuing the request. A stored procedure can be a simple SQL statement such as this one:

Select * from authors 

A stored procedure can also be a series of complex SQL statements and control-of-flow language statements that apply a complex business rule or task to a series of tables ...

Get Microsoft® SQL Server™ 2000 DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.