Posted on: December 26, 2019 Posted by: admin Comments: 30

SQL Server Programming Part 12 – Cursors

If you’d like to help fund Wise Owl’s conversion of tea and biscuits into quality training videos you can click this link to make a donation. Thanks for watching!

By Andrew Gould

– Most of the operations you perform in SQL work against an entire set of records in one go. Cursors, on the other hand, allow you to process a set of records one row at a time. In this video you’ll learn how to declare a cursor and how to make it step through a set of records. Along the way you’ll learn about the various FETCH statements and additional cursor options. From a practical point of view you’ll see how to execute a stored procedure against each record in a table and how to use a cursor to update data in a table by creating a running total column.

You can download the script to create the Movies database used in this video at the following link:

For more technical details on the various cursor options see:

You can see the range of resources and courses we offer in SQL Server here:

Visit for more online training resources in Microsoft Excel, Microsoft Access, Microsoft PowerPoint, Microsoft Word, Microsoft Project, Microsoft Publisher, Microsoft Visio, SQL Server, Reporting Services, Analysis Services, Visual Studio, ASP.NET, VB.NET, C# and more!


Xem thêm bài viết:


30 People reacted on this

  1. 'Specifies that the membership and order of rows in the cursor are fixed when the cursor is opened.'
    what does the word 'membership' from the above sentence refers to?

  2. For anyone following along with the video and using the Movies database that's linked above, note that you won't have the FilmCumulativeOscars column in your tblFilms table, you'll need to add it in.

  3. Out of all of you who have commented such nice things as "amazing", "easy to understand", "riveting". "super dope", "excellent", "superb", "Very helpful", "really appreciate", "better than college/university", "absolutely great", "best free tutorials", "helped me get a job", etc., etc….How many of you have donated at least $1.00 using the link in the description? 🙂

  4. Awww yiiis!! ( *^*)/ This tutorial was excellent!, you helped me out of finding a solution to parse individual update of records, for my work's random date add value per row problem.

    Ahaaa! Thank you, 😀 Thank you oh great wise owl sir! <3 ~

  5. What program setup do people use to program SQL code like this? I have MySQL with XAMPP apache server and the two database languages conflict to where the syntax is always wrong. Really frustrating trying to learn from these tutorials and have MySQL constantly telling me I'm wrong.

  6. Hands down best SQL Server tutorials on YouTube and probably the net. There are poor fools paying a lot of money for INFERIOR training to this. Glad I'm not one of them 🙂

  7. Thanks mate for making such useful and easy-to-understand videos. I am thinking of sharing my experience with our managers to see if they are willing to arrange an on-site training for our analysts within the organisation.

Leave a Comment