From the course: Microsoft SQL Server 2022 Essential Training
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Introduction to stored procedures - SQL Server Tutorial
From the course: Microsoft SQL Server 2022 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
Create a view of the data8m 33s
-
(Locked)
Data table indexes3m 49s
-
(Locked)
Create additional indexes on a table2m 52s
-
(Locked)
Aggregate functions7m 14s
-
(Locked)
Use built-in functions5m 15s
-
(Locked)
Leverage user-defined scalar functions7m 12s
-
(Locked)
Introduction to stored procedures3m 58s
-
(Locked)
Create stored procedures5m 34s
-
(Locked)
Parameterized stored procedures4m 42s
-
-
-
-
-