From the course: Program Databases with Transact-SQL
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Stored procedure output parameters - SQL Server Tutorial
From the course: Program Databases with Transact-SQL
Stored procedure output parameters
- [Instructor] Sequel servers stored procedures can pass information back through the use of output parameters. This is mostly used when a front end application is used to interface with the database server. And it allows the stored procedure to communicate success messages or other important status updates to the application. Since we're not in an environment where we're actually writing a custom application for the database, output parameters are a little bit tricky to demonstrate, but we can write a small example to show how they work. When you create a stored procedure, that includes an output parameter, you name it just like you would with input parameters. I'm going to create a sample procedure called USP simple procedure, and it's going to have an output parameter called output message. We still need to give it a data type. So I'll give this one the nvarchar200 data type, and then we need to make sure that we include the keyword output at the end. This tells sequel server that…
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
-
-
-
-
-
(Locked)
Write and execute a stored procedure7m 43s
-
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
-
(Locked)
-
-
-
-