From the course: Microsoft SQL Server 2022 Essential Training

Unlock this course with a free trial

Join today to access over 23,100 courses taught by industry experts.

Introduction to stored procedures

Introduction to stored procedures

- [Instructor] Stored procedures are SQL Server's way of bundling blocks of code into reusable units that can be called on by an application or another user of the database. These can be anything from a simple select statement or a more complex collection of database requests, programmatic functions, and loops. There are several benefits to using stored procedures over issuing raw TSQL commands to the database. First, they're more consistent. Every time I ask for customer orders using a stored procedure, I can be assured that the database will process all of the tables involved in such a query in exactly the same way. Further, when all of the applications that interact with a database utilize the same stored procedure, it makes maintenance much easier. To make a change, you simply update the single stored procedure that they all reference rather than update every application's internal logic if they were all making…

Contents