From the course: Designing Database Solutions for SQL Server 2016

Unlock the full course today

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

Create stored procedures

Create stored procedures

- [Instructor] Stored Procedures are SQL servers' way of bundling blocks of code into reusable units that can be called by an application or other user of the database. These can be anything from a simple select statement to more complex collections of database requests, programmatic functions and loops. There are several benefits to using stored procedures over issuing raw T-SQL commands to the database. First, they're more consistent. Every time I ask for a customer's order 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 the 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 updating every application's internal logic if they're all making calls to the database on their own. Second, they're more secure. The…

Contents