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

Stored procedure output parameters - SQL Server Tutorial

From the course: Program Databases with Transact-SQL

Start my 1-month free trial

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…

Contents