From the course: Developing Microsoft SQL Server 2016 Databases
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Write a stored procedure with T-SQL - SQL Server Tutorial
From the course: Developing Microsoft SQL Server 2016 Databases
Write a stored procedure with T-SQL
- [Instructor] I'd like to take a look at creating our first stored procedure using the WideWorldImporters database. So the first two lines I want to run here are lines two and three just to jump into WideWorldImporters. To see what procedures already exist in the database, you can go over to the object explorer and expand the Databases folder and then expand the folder for the database you want to work with. Stored procedures can be found inside of the Programmability folder, and then we'll finally find a folder for stored procedures. And here's a listing of all the different stored procedures that currently exist in this database. We can also get a similar listing by using a T-SQL command, and I've got the code for that over here on line six through 11. We're going to select the function named Schema_Name, and we'll apply it to the schema_id field out of a table called sys.procedures. Then we'll provide an alias. We'll…
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.