Join Martin Guidry for an in-depth discussion in this video Using input and output parameters, part of SQL Server: Triggers Stored Procedures and Functions.
Now I'd like to talk about sending input parameters and returning output…parameters from a stored procedure.…These are optional.…We have worked with stored procedures thus far without working with parameters,…so they are optional.…I have some code on the screen.…It's available in our exercise files.…It basically alters the stored procedure and then executes the stored procedure.…So I am going to alter the stored procedure to include a 1 input parameter for now.…I do that by creating some parentheses.…
We will need to put all of our parameters in parentheses.…Then I need to give the parameter a name.…And remember, in SQL Server, variable names always start with the at sign, and…beyond that, you can name it almost anything you would like to name it.…We will also need to declare what datatype we're going to use.…Any of the typical SQL Server datatypes are in play, so for example, integer,…varchar, datetime, all of those are perfectly valid.…So I will declare this one as an integer.…
So we're going to alter this procedure to now accept one parameter.…
Author
Released
9/24/2012- Comparing triggers, functions, and stored procedures
- Installing and configuring SQL Server
- Creating a stored procedure
- Returning data using data sets
- Creating user-defined functions
- Using "after," "instead," and nested triggers
- Modifying existing stored procedures
- Implementing logging on DELETE
- Choosing between T-SQL and CLR
- Executing a stored procedure
- Passing parameters
Skill Level Advanced
Duration
Views
Related Courses
-
Introduction
-
Welcome47s
-
-
1. Getting Started
-
Why use a stored procedure?4m 59s
-
Why use functions?1m 27s
-
Why use triggers?1m 10s
-
2. Installing SQL Server
-
Configuring your environment4m 53s
-
-
3. Stored Procedures
-
Creating a stored procedure2m 46s
-
Modifying a stored procedure2m 34s
-
Returning data using cursors3m 45s
-
Using transactions2m 47s
-
-
4. User-Defined Functions
-
5. Triggers
-
Using "after" triggers3m 47s
-
Using nested triggers1m 38s
-
-
6. Putting It All Together
-
7. Using CLR Assemblies
-
8. Exploring an ASP.NET Web Application
-
Passing parameters3m 41s
-
Getting return values2m 53s
-
Conclusion
-
Next steps1m 43s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Using input and output parameters