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

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…

Contents