From the course: Complete Guide to Advanced SQL Server
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Solution: Use function in a stored procedure - SQL Server Tutorial
From the course: Complete Guide to Advanced SQL Server
Solution: Use function in a stored procedure
So I hope you are able to create a stored procedure that allows end users to easily review customer account information. I currently have the starting file up here on the screen, so the first thing we need to do is just make sure that we're using the Wide World Importers database, which I already am. And then I'm going to create this table here. That'll get me started. And if I wanted to, I can review some existing information from Sales.Customers and Sales.Orders. So I just go ahead and run these two lines. So I could have both of these tables on the screen so they're easy to reference. So let's scroll down here on the script. And here is a reminder of what it is that we're trying to accomplish. So we need to write a stored procedure that's going to view some information from Sales.Customers, view information from Sales.Orders, which is the bottom table here, and then write a row to the new table that we just created. So let's get started. I'm going to create a new procedure. And I…
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
-
-
-
-
-
Write and execute a stored procedure7m 43s
-
(Locked)
Stored procedure input parameters7m 38s
-
(Locked)
Stored procedure output parameters3m 38s
-
(Locked)
Create a database trigger3m 37s
-
(Locked)
Challenge: Use function in a stored procedure1m 25s
-
(Locked)
Solution: Use function in a stored procedure7m 43s
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-