🗃️Stored Procedure
Also known as Stored Proc, SQL Procedure
A small program saved in the database. The app calls it by its name.
Think of it like
Think of it like a recipe card kept in the kitchen. The cook can use it without you reading it out.
Example
Emma's bank has a stored procedure called close_month. Each night it adds interest to 80,000 accounts, and the data never leaves the server.
Why it matters
Some jobs are much faster when they run where the data lives. Stored procedures do that.
Definition
Common mistake
Key takeaways
- 1Lives in the database. Saved there, run there.
- 2Called by name. The app sends one call.
- 3Hard to move. Each database writes them its own way.