The Weird World Of SQL Server API Cursors #tsql2sday

The Weird World Of SQL Server API Cursors #tsql2sday



Thanks for watching!

Going Further


If this is the kind of SQL Server stuff you love learning about, you’ll love my training. I’m offering a 75% discount to my blog readers if you click from here. I’m also available for consulting if you just don’t have time for that, and need to solve database performance problems quickly. You can also get a quick, low cost health check with no phone time required.



9 thoughts on “The Weird World Of SQL Server API Cursors #tsql2sday

  1. So are the benefits of api cursors is so that you can x behavior in batches? Now with the pass in params, are those values documented anywhere? I saw the doco from MS looks pretty barren. Should I be asking Paulie these questions? Is this tactic more useful than the generic batching template we all have some version of? Im not trying to be sassy here, Im genuinely interested in understanding this so that it can be a part of my tool box so to speak.

    1. Curiously, I cover most of this in the video.

      The reason I like it as a batching alternative is that the cursor keeps track of where it left off, so you don’t have to include any logic to move it forward like a WHILE loop. It also knows when it’s time to stop.

      The syntax is much more difficult to manage, so you do need to choose your battles carefully between the two.

  2. Old Skool !
    those things are seriously tricky to work with if you are getting performance issues.
    Any ideas as to how they get handled in Query Store ?

Leave a Reply

Your email address will not be published. Required fields are marked *