Join Martin Guidry for an in-depth discussion in this video Returning data using cursors, part of SQL Server: Triggers Stored Procedures and Functions.
Next, I'd like to talk about returning data from a stored procedure using a cursor.…A cursor is a data structure that contains multiple rows of data, and it allows…us to cycle through each row one at a time and perform an action on each row.…Returning a cursor from a stored procedure is pretty similar to returning data…from a stored procedure using output parameters.…And in a lot of ways you can think of a cursor as a special type of output parameter.…I have some code on the screen.…This code is available in your exercise files.…
The top-half of this code is going to create a stored procedure called procedure…cursor that accepts one parameter that's called Authors, and that parameter has…a data type that is defined by two words;…one word is CURSOR and the second word is VARYING.…Meaning, this cursor isn't always going to be exactly the same.…It could be a different size based on the data that's currently in the database.…This cursor will sometimes return a different number of records than other times.…
- 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
1. Getting Started
2. Installing SQL Server
Configuring your environment4m 53s
3. Stored Procedures
4. User-Defined Functions
6. Putting It All Together
7. Using CLR Assemblies
8. Exploring an ASP.NET Web Application
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.Cancel
Take 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.