What Are Stored Procedures?
In the Microsoft SQL Server documentation, a stored procedure is defined as “a precompiled collection of SQL statements and optional control-of-flow statements stored under a name and processed as a unit.” Put more simply, a stored procedure is like a method or function—it performs a set of actions on the data in your database. They normally encapsulate an area of functionality, such as adding a new record to a table, or returning a specific set of information.
Stored procedures offer a number of benefits. First, because they are precompiled, they generally perform better than a straight SQL call directly from your application. Additionally, by channeling all data access in your application through a set of stored ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access